HTML5 introduces a number of new elements and attributes that reflect typical usage on modern websites. The new standard incorporates features like video playback and drag-and-drop that have been previously dependent on third-party browser plug-ins(for example, flash).
DOCTYPE and Character Set
HTML has really long DOCTYPES and are hard to remember, or at least I have always copied them from some reliable source. For example, XHTML strict:HTML5 has a nice memorable short DOCTYPE:Source code viewer
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">Programming Language: HTML
Source code viewer
<!DOCTYPE html>Programming Language: HTML
Like the new DOCTYPE, the character set declaration has also been abbreviated.
Source code viewer
<!--HTML Meta Tag--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--HTML5 Meta Tag--> <meta charset="utf-8" />Programming Language: HTML
HTML5 elements
Example HTML5 Page:Changes in HTML5:Source code viewer
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Example Page</title> </head> <body> <header> <h1>Page Title</h1> <p>Slogan</p> </header> <nav> <ul> <li class="selected"><a href="index.html">Home</a></li> <li><a href="page2.html">Page2</a></li> <li><a href="page3.html">Page3</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> <section id="articles"> <article> <header> <h2>Article Title</h2> </header> <p>This is article 1.</p> <footer> Article Footer </footer> </article> <article> <header> <h2>Article Title</h2> </header> <p>This is article 1.</p> <footer> Article Footer </footer> </article> </section> <footer> © </footer> </body></html>Programming Language: XML
HTML5 is definitely better solution, but I wouldn't use it for general websites yet, because you would have to make a lot of workarounds for older browsers. IEs below version 9 haven't got HTML5 support as well.
But in general HTML5 should replace Flash and Silverlight. So no annoying update notices and extra plug-ins to install.
But in general HTML5 should replace Flash and Silverlight. So no annoying update notices and extra plug-ins to install.