Basic New HTML5 Tags

Basic New HTML5 Tags

From what I’ve seen of html5, the thing I really like is the new tags, which make clean leaner and more semantic. Here is a quick cheat guide to some of the more useful tags:

 

<body>

<header></header>

<nav></nav>

<article>

<section></section>

</article>

<aside></aside>

<footer></footer>

</body>

 

In order for these to work in Internet Explorer, you need to add this to the head of your pages:

<!–[if lt IE 9]>
<script>
document.createElement(‘header’);
document.createElement(‘nav’);
document.createElement(‘section’);
document.createElement(‘article’);
document.createElement(‘aside’);
document.createElement(‘footer’);
</script>
<![endif]–>

<!–[if lt IE 9]>
<script src=”//html5shiv.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>

You also need to this to your CSS:

header, nav, section, article, aside, footer {
display:block;
}

Please follow and like us:
Tags: