Code for HTML5/CSS Layout

Replacing HTML 4 (top) with HTML 5 (bottom)

Replacing this:

HTML 5 example

Nothing has changed that radically—the elements are a bit different, but they reflect common semantics that you find on many websites that developers tend to create using <div> elements, for example <div id=”header”>, which is replaced with <header> in HTML5. You’ll also notice that the DOCTYPE is much simpler than the ones you saw earlier.

Try it yourself!
You can start experimenting with these new elements already, even though browsers don’t yet officially support them. All you have to do is write a rule in your CSS to make them all display as block elements. Try this out!

For HTML 5 to work on all browsers, you must add the following property to your CSS file.

For HTML 5 to work with IE, you need to add this to the script below to the <head> of your HTML file.