HTML5 is the latest and greatest standard for HTML. It incorporates some features of HTML4.01 and some of XML, but also brings many new exciting capabilities to the web including a graphics canvas, audio, and video capabilities.
HTML5 tightens the specification for HTML so there are fewer problems with browsers interpreting things differently. It provides many capabilities that previously required plugins and add-ons so that advanced capabilities will be available across a wide array of Internet appliances.
For someone who likes to hand-code things, as I do, it’s also easier than previous versions of HTML, although there is a lot more to learn, only because it is so capable.
HTML5 is still an evolving standard but already most major browsers implement a large portion of it, enough so that it is currently possible to include video, auto, and graphical content without the need for plugins. It is also easy to write code that is HTML5 compliant but also backwards compatible with older browsers.
<!DOCTYPE html> <html lang="en-US"> <html> <head> <title>Hello World!</title> </head> <body> <p>Hello World!</p> </body> </html>
Notice that the DOCTYPE for HTML5 is simply “HTML”. What could be simpler than that? The presence of this doctype puts browsers in standards mode so there is at least a chance they’ll do the right thing.
Some sites don’t consider the language declaration to be important but I prefer not to make the browser guess and guarantee that the correct character set is used to render the document.
Just as with previous versions of HTML, you have <html> and the closing </html> tags surrounding the header and body.
The header section is enclosed in <header> and </header> tags and the body in <body> and </body> tags, just as with previous versions.
HTML5 can be coded in either HTML format or XHTML format. If you want to type <br> or <br />, either will work. Browsers will parse both HTML5 and XHTML5 identically.
Many deprecated tags, such as <center> and <font>, are no longer supported because their functions have been replaced by style sheets. Now if only Browser vendors would make all style sheet code work properly.