I’ve been mean­ing to con­vert Super­pos­i­tion Kitty to HTML5 for a while now, but it wasn’t until I read Mark Pil­grim’s excel­lent Dive Into HTML5 that I dove in (as it were). Below is how you can eas­ily con­vert any exist­ing *HTML page to HTML5:

Replace your doc­type with <!DOCTYPE html>.

That’s it, you’re done. Of course, in doing just this you’re not going to be tak­ing advant­age of any of HTML5’s won­drous new fea­tures. I’m not tak­ing advant­age of any of these fea­tures at the moment either, but I did want to pave the way for imple­ment­ing them in the future.

How­ever, before we run off into the won­der­ful world of <header>, <footer>, and <article> tags and their ilk, we’re going to have to add a line of code to the <head> of our doc­u­ment to get Inter­net Explorer to treat them properly:

<script src="http://html5shiv.googlecode.com/svn/trunk/ html5.js"></script>

With that out of the way we can now go crazy with these new semantic ele­ments. I’ve updated the struc­ture of Super­pos­i­tion Kitty as below:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
</head>
<body>

  <header>
    <nav>
    </nav>
  </header>

  <article>
    <header>
      <h1>Post Title</h1>
      <time datetime="" pubdate></time>
    </header>
      <p>Content</p>
  </article>	

  <footer>
  </footer>

</body>
</html>

This is just to give you some ideas of how to use these new semantic ele­ments in your markup. Also, there are a couple of things you’re going to want to know if you’re using the <embed> code sup­plied by You­Tube or Vimeo in your posts. The first is that you should add type="application/x-shockwave-flash" to the <object> ele­ments. The second is that the <param> and <embed> ele­ments must be closed with /> in their start tags, with no end tags (eg. </param>) allowed.

There are a few other dif­fer­ences in markup between pre­vi­ous ver­sions of HTML and HTML5 (such as <script> and stylesheets no longer need­ing type=""), you’ll find a good break­down of what you’ll need to know here.


Leave a Reply

Details

'Superposition Kitty: Now In HTML5' was posted on May 2nd, 2010 in the Category: News You Should Know.

You can subscribe to the comments on this post, or post a comment of your own



Related Posts