HTML 5
Html 5 is next generation of HTML and it's defined by W3C. HTML5
introduces a number of new elements and attributes that reflect typical usage on
modern websites. Some of them are replacements for common uses of generic block
(<div>) and inline (<span>) elements, for example <nav> (website navigation
block), <footer> (usually referring to bottom of web page or to last lines of
HTML code), or <audio> and <Video>instead of <object>.
Features
Some of the most interesting new
features in HTML5:
-
The canvas element for
drawing
-
The video and audio
elements for media playback
-
Better support for
local offline storage
-
New content specific
elements, like article, footer, header, nav, section
-
New form controls, like
calendar, date, time, email, url, search
Browser Support
HTML5 is not
yet an official standard, and no browsers have full HTML5 support.
But all major
browsers (Safari, Chrome, Firefox, Opera, Internet Explorer) continue to add new
HTML5 features to their latest versions.
Following
are the some examples of new attributes in HTML5
Code example of
<Video> tag :
<!DOCTYPE
HTML>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="movie.ogg" type="video/ogg" />
<source src="movie.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
</body>
</html>
|
Code example of
<Audio> tag :
<audio controls="controls">
<source src="horse.ogg" type="audio/ogg" />
<source src="horse.mp3" type="audio/mp3" />
Your browser does not support the audio element.
</audio>
|
Code example of
<footer> tag :
<!DOCTYPE
HTML>
<html>
<body>
<footer>Copyright© reserved</footer>
</body>
</html>
|
Code example of < canvas >
tag :
<canvas id="myCanvas" width="200" height="100"></canvas>
|
HTML 5 improves interoperability,
and reduces development costs, by making precise rules on how to handle all HTML
elements, and how to recover from errors.