A Web Design Community curated by Chris Coyier

Code Snippets Gallery

Code Snippets > HTML > HTML5 Page Structure Submit one!

HTML5 Page Structure

<!DOCTYPE HTML>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Your Website</title>
</head>

<body>

	<header>
		<nav>
			<ul>
				<li>Your menu</li>
			</ul>
		</nav>
	</header>

	<section>

		<article>
			<header>
				<h2>Article title</h2>
				<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="#">Writer</a> - <a href="#comments">6 comments</a></p>
			</header>
			<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
		</article>

		<article>
			<header>
				<h2>Article title</h2>
				<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="#">Writer</a> - <a href="#comments">6 comments</a></p>
			</header>
			<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
		</article>

	</section>

	<aside>
		<h2>About section</h2>
		<p>Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
	</aside>

	<footer>
		<p>Copyright 2009 Your name</p>
	</footer>

</body>

</html>

9 Responses

  1. haRacz says:

    And where is charset ?

  2. Mizou says:

    Just a query about the double inside the and also where is the ?
    Thanks for your very clear & useful website and I introduced my webdesign students to your video’s and they find it very helpful too.

  3. Mizou says:

    Hmm it looks like the code I wrote did not come up in the text, so I try it again and hope it will be rendered ok:

    I was wondering about the double <p> <p> inside the <article> ?
    … and also where is the <h1> ?

    Thanks

  4. Edd Turtle says:

    if it’s of interest I wrote an article on HTML5 here: http://www.turtleblog.co.uk/2009/09/whats-new-to-html5/

  5. Helen says:

    Some page don’t look like a little girl’s blog. They have one piece of article but several navs and asides. Keep using xhtml-strict and use roles and titles!

  6. Isn’t there a new deffinition for the charset meta tag in the html5 spec? i.e.

    <meta charset="UTF-8">

    *just googled it and found an answer. (yes was the short answer).

  7. Ant says:

    I am just thinking about nav tag, is it really necessary? I never used div#nav>ul structure, instead ul#nav.

  8. Kelly Copley says:

    For charset the specs actually offer 3 methods..

    1. transport level content-type header.
    2. new charset meta tag
    3. Unicode byte order mark

  9. Eugene says:

    Without a style it will look like ordinary text or …?

Leave a Comment

Remember:
  • Be nice.
  • Wrap multiline code in <pre> and <code> tags and escape it first (turn <'s into &lt;'s).
  • You may use regular HTML stuff like <a href="">, <em>, and <strong>
* This website may or may not contain any actual CSS or Tricks.