No More IE6! Detect IE6 Browsers without using javascript

Click on the picture to enlarge

Internet Explorer 6 is old and outdated, but it still holds a fairly strong position in the browser market. There are many reasons why this is the case, but we're not here to discuss that at the moment... we're here to appeal to all web developers!

If you are a web developer, own a website, occasionally work on a website, or even know a friend who has a website, then the following code may be of use to you.

Simply add it to your code at the top of the HTML page (just after the <body> tag) and let it do the rest.

 

<!--[if lte IE 6]>
<style type="text/css">
	body { padding-top: 70px !important; }
	.IE6warn { width: 100%; position: absolute; top: 0; left: 0; display: block; z-index: 2; }
	.IE6warn .content { display: block; text-align: left; margin: auto; position: relative; width: 770px; }
	.IE6bkgnd { opacity:.50; -moz-opacity:.50; filter:alpha(opacity=50); display: block; width: 100%; height: 70px; background-color: #ffee88; border: 2px solid #ccaa55; position: absolute; top: 0; left: 0; z-index: 1; }
	.IE6warn a { display: inline; margin: 10px; float: left; }
	.IE6warn span { display: block; width: 350px; height: 70px; font-size: 12px; color: #000000;  float: left; padding: 15px 0 15px 0; }
</style>
<div class="IE6bkgnd"></div>
<div class="IE6warn">
	<div class="content">
		<a target="_blank" href="http://www.mozilla.com/firefox/"><img src="http://www.oomta.com/www/images/icon_firefox.png" /></a>
		<a target="_blank" href="http://www.microsoft.com/windows/Internet-explorer/default.aspx"><img src="http://www.oomta.com/www/images/icon_ie.png" /></a>
		<a target="_blank" href="http://www.apple.com/safari/download/"><img src="http://www.oomta.com/www/images/icon_safari.png" /></a>
		<a target="_blank" href="http://www.google.com/chrome"><img src="http://www.oomta.com/www/images/icon_chrome.png" /></a>
		<a target="_blank" href="http://www.opera.com/download/"><img src="http://www.oomta.com/www/images/icon_opera.png" /></a>
		<span>
			Your browser is outdated. This site may not be compatible.<br />
			<strong>Upgrade now!</strong><br />
			We recommend Firefox. It's fast and it's free!
		</span>
	</div>
</div>
<![endif]-->

If every site adapts to using a script like this or similar, it'll make the transition move a little faster!


Post a comment below

Name *
E-Mail *
Comment *