Lecture 3
Lecture 3
Tag Structure
DOCTYPE
The doctype for HTML 4.01
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
In HTML5
<link rel="stylesheet" href="file.css">
SECTION
ARTICLE
HEADER
FOOTER
ASIDE
FIGURE
NAV
Forms in HTML5
In Chrome
In Blackberry
web browser
Forms in HTML5
New attributes
Autofocus attribute
<input id="status" name="status" type="text" autofocus>
Placeholder attribute
<label for="search">My Search</label>
Autocomplete attribute
<input type="text" name="onetimetoken" autocomplete="off">
Offline Web Applications
Allow you to keep using web apps and sites
without a network connection
Browsers cache data in Application cache
# Fallback content
FALLBACK:
fallback.js fallbackserver.js
/fallback.html
Canvas
The canvas element provides scripts with a
resolution-dependent bitmap canvas, which can
be used for rendering graphs, game graphics,
or other visual images on the fly.
Canvas gives an easy and powerful way to draw
graphics using Javascript.
context.fillStyle = '#00f'; //
blue
context.strokeStyle = '#f00'; // red
context.lineWidth = 4;
context.fillStyle = '#00f';
context.font = 'italic 30px sans-serif';
context.textBaseline = 'top';
context.fillText('Hello world!', 0, 0);
context.font = 'bold 30px sans-serif';
context.strokeText('Hello world!', 0, 50);
Videos
HTML5 provides a standardised way to play
video directly in the browser, with no plugins
required.
autoplay
<video src=leverage-a-synergy.ogv autoplay>
</video>
poster
<video src=leverage-a-synergy.ogv poster >
</video>
height , width
loop
<video src=leverage-a-synergy.ogv loop >
</video>
preload = none
<video src=leverage-a-synergy.ogv preload=none >
</video>