Formatting HTML5 and Browsers

by bitznbitez

Most HTML4 browsers will interpret the new HTML5 tags as if they are simply new tags you have invented.    Ergo you can format them in your CSS file like so.

header, nav, footer, article {display:block;}
nav {float:left; width: 20%; }
article {float:right; width:79%;}
footer {clear: both;}

Of course there is always an exception, and like often is the case its Microsoft IE.   The current version of IE will not perform correctly at all unless you kludge it with the following javascript.

<script>;
 document.createElement(‘ header’ );
 document.createElement(‘ nav’ );
 document.createElement(‘ article’ );
 document.createElement(‘ footer’ );
</script>;

Which can be encapsulated to only be part of the header if you are running against IE.   Also this will not work for printing which case still be problematic.

Thats my observation from tonights readings…

Advertisements