HTML 4 HTML 5
HTML 4 HTML 5
HTML5
HTML 4 HTML 5
Syntax: Syntax:
It's Syntax is little complex. It has Simplified and clear syntax.
For doctype used: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" For doctype use: <!DOCTYPE html>
"http://www.w3.org/TR/html4/strict.dtd">
Multimedia: Multimedia:
The multimedia content was integrated in web pages via third party plugins HTML5 contains built in support for integrated multimedia files into web page
such as Silverlight and flash. via video and audio tags.
Added more elements to HTML 5 which does not exist in HTML 4. HTML 5 has many new elements that are not present in HTML 4.
The elements exist in HTML 4 has been removed from HTML 5 and few HTML 5 has dropped certain elements.
deprecated tags.
Was developed by World Wide Web consortium and WHATWG (web hypertext Is being developed by web hypertext application technology working group
application technology working group). (WHATWG) and W3C HTML WG.
Tag Description
Tag Description
<datalist> Specifies a list of pre-defined options for input controls
Tag Description
HTML5 Graphics
Tag Description
The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics.
Note: Any text inside the <canvas> element will be displayed in browsers that does not support <canvas>.
Attributes
SVG has several methods for drawing paths, boxes, circles, text, and graphic images.
Media Elements
Definition and Usage
The <audio> tag defines sound, such as music or other audio streams.
Attributes
autoplay autoplay Specifies that the audio will start playing as soon as it is ready
controls controls Specifies that audio controls should be displayed (such as a play/pause
button etc)
loop loop Specifies that the audio will start over again, every time it is finished
preload auto Specifies if and how the author thinks the audio should be loaded when
metadata the page loads
none
• MP4 = MPEG 4 files with H264 video codec and AAC audio codec
• WebM = WebM files with VP8 video codec and Vorbis audio codec
• Ogg = Ogg files with Theora video codec and Vorbis audio codec
autoplay Autoplay Specifies that the video will start playing as soon as it is ready
controls Controls Specifies that video controls should be displayed (such as a play/pause
button etc).
loop Loop Specifies that the video will start over again, every time it is finished
muted Muted Specifies that the audio output of the video should be muted
poster URL Specifies an image to be shown while the video is downloading, or until
the user hits the play button
preload auto Specifies if and how the author thinks the video should be loaded when
metadata the page loads
none