Disappointment with IE.

A pivotal question in development is whether to use new technology or not. HTML5 and CSS can make great pages but Internet Explorer, being a huge portion of the browsers used, does not handle these except in the most recent versions. A quick google search led me to this page which had a great script to work with this problem. The work around is to create new elements to match HTML5. The detailed analysis is located in the link above.

<!--[if IE]-->
	<script type="text/javascript">
		(function(){
			var html5elmeents = "address|article|aside|audio|canvas|command|datalist|
				details|dialog|figure|figcaption|footer|header|hgroup|
				keygen|mark|meter|menu|nav|progress|ruby|section|
				time|video".split('|');
			for(var i = 0; i < html5elmeents.length; i++){
			document.createElement(html5elmeents[i]);
			}
		}
	)();
	</script>
<!--[endif]-->

EDIT: Got the page looking like I want it in IE, Firefox and Chrome/Safari but found the above script was not needed.  I surrounded my HTML5 elements (<header>, <footer>, and <nav>) with <div> tags that include the desired HTML5 element.  This makes for an easy move to HTML5 when it’s more broadly implemented. Example:

<div class="footer">
	<!-- Include the same class name only if you want CSS styling specific to the footer -->
	<footer class="footer">This is my footer text.</footer>
</div>
.footer {
	position: absolute;
	background-color: black;
}

Leave a Reply

Your email address will not be published. Required fields are marked *