The New HTML5 Doctype
Download Example.

So…if you are special..then you probably didn’t memorized how to write our the doctype character-by-character. Well, guess what? That’s totally fine for HTML because all you need to write at the top of your documents now is:
<br />&lt;!DOCTYPE html&gt;<br />
And remember how you used to divide and group everything with the div tag, followed by specifying them with classes and ids? Well, HTML5 provides a new semantic vocabulary for parts of your webpage that can now be referenced as something else. Look at the diagram below followed by the example markup.

If you downloaded the example, then you’ll see that where we would have used the div tag was replaced by a couple of these new elements. They are listed and explained below:
- The
headerelement represents the header of a section. Headers may contain more than just the section’s heading—for example it would be reasonable for the header to include sub headings, version history information or bylines. - The
navelement represents a section of navigation links. It is suitable for either site navigation or a table of contents. - The
asideelement is for content that is tangentially related to the content around it, and is typically useful for marking up sidebars. - The
articleelement represents an independent section of a document, page or site. It is suitable for content like news or blog articles, forum posts or individual comments. - The
sectionelement represents a generic section of a document or application, such as a chapter, for example. - The
footerelement represents the footer for the section it applies to. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.
How to Write Your First HTML5 Document
There’s not too much different. If anything, things just got more simplified. You already know how to start with the doctype. Lets look at the rest:
<br />&lt;!DOCTYPE html&gt;<br />&lt;html lang="en"&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;head&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;meta charset="UTF-8"&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;title&gt;HTML Revisited: Hello World 2010&lt;/title&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;link rel="stylesheet" type="text/css" href="style.css" media="screen" &gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;/head&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;body&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;div id="container"&gt;<br /><%%KEEPWHITESPACE%%> &lt;header&gt;<br /><%%KEEPWHITESPACE%%> &lt;h1&gt;&lt;code&gt;h1&lt;/code&gt; tag inside header element&lt;/h1&gt;<br /><%%KEEPWHITESPACE%%> &lt;/header&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;nav&gt;<br /><%%KEEPWHITESPACE%%> &lt;ul&gt;<br /><%%KEEPWHITESPACE%%> &lt;li&gt;List Item 001&lt;/li&gt;<br /><%%KEEPWHITESPACE%%> &lt;li&gt;List Item 002&lt;/li&gt;<br /><%%KEEPWHITESPACE%%> &lt;li&gt;List Item 003&lt;/li&gt;<br /><%%KEEPWHITESPACE%%> &lt;/ul&gt;<br /><%%KEEPWHITESPACE%%> &lt;/nav&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;section&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;h1&gt;This is a &lt;code&gt;section&lt;/code&gt;&lt;/h1&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;aside&gt;<br /><%%KEEPWHITESPACE%%> &lt;h2&gt;Learning New Structural Elements&lt;/h2&gt;<br /><%%KEEPWHITESPACE%%> &lt;/aside&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;article&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;h2&gt;This is a paragraph inside of an element called &lt;code&gt;article&lt;/code&gt;.&lt;/h2&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;/article&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;/section&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;footer&gt;<br /><%%KEEPWHITESPACE%%> &lt;p&gt;This is a paragraph inside of an element called &lt;code&gt;footer&lt;/code&gt;.&lt;/p&gt;<br /><%%KEEPWHITESPACE%%> &lt;/footer&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;/div&gt;&lt;!--end of container--&gt;<br /><br /><%%KEEPWHITESPACE%%> &lt;/body&gt;<br /><br />&lt;/html&gt;<br /><br />
Notice how we’re still backwards compatible. We’re still using the div element to group everything together, but we’ve now replaced all the inner divs with the new structural elements. This may help you wrap your mind around your groupings better.
What Does the CSS Look Like
Good question. It also isn’t too complicated. The new CSS3 will be looking for these items if you’re coding in HTML5. Take a look at some example rules within a stylesheet:
<br />header {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br />}<br /><br />nav {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br />}<br /><br />section {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br />}<br /><br />article {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br /><br />}<br /><br />aside {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br />}<br /><br />footer {<br /><br /><%%KEEPWHITESPACE%%> /* Insert Your Styles here */<br />}<br /><br />