HTML5 is certainly one of the latest buzzwords in the web community. It isn’t something new anymore and we’ve already seen how cool it is. Features like simplified doctype, more semantic markup, input types and placeholders are just some of the reasons you’d like to use a HTML5 template.
So, today we’re going to build a HTML5 template using the full power of CSS3.
I wanted to create this HTML5 template demo without using any images and I made it. So, for the website background, instead of linking to an external image I just embedded that image with data URIs.
So the result is something like that:
The encoded image is basically a pattern.
Not so beautiful, huh? Yet, this is very effective. The pros: no extra HTTP image request. The cons: IE6/IE7 lack of support (but there’s a solution also for that).
I could have used a CSS3 pattern instead this solution, but the above has its own advantages: one is the fact it works on IE8.
The Document Type Declaration, a.k.a doctype was always an ugly and hard-to-remember thing. Not anymore.
Check out the new doctype declaration, that tells a browser or other parsers that they are looking at a HTML5 document:
The HTML5 header
The body
The template’s body consists of two blocks:
<aside> - who wraps the navigation
<div id="content"> - who wraps the <article> elements.
Keep in mind that now that we have these new HTML elements, we should not forget entirely about the <div> element as some jobs are still available for it.
The animated menu
Pretty semantic code.
The jQuery code who animates this menu:
The main HTML5 footer
The CSS
Below you can find the styles used to build this HTML5 template layout. Prefixed properties are excluded, you’ll find them in the demo page source.
Browser support
This is a cross browser HTML5 template which use graceful degradation. So, you don’t have to worry for older browsers like the IE trident - they render the layout in a good way thanks to the HTML5 shiv:
Conclusion
Browsers are evolving, web technologies are constantly being updated so we have no time to rest. We need to stay up to date with latest specifications and the best way to learn is by actually doing it.
The purpose of articles like this one is to encourage you to use these new web technologies. And yes, you can use this HTML5 template right now!
If you liked this article, and I hope you did, please spread the word!