Display a warning message to IE6 users

As per latest W3schools Browser statistics (last updated on November 2010), 4.1 % of web surfers still use Internet Explorer 6. It has become outdated and Windows has also stopped supporting it now. But still a significant amount of users use Internet Explorer 6. Internet Explorer 6 is known for security vulnerabilities besides being incompatible with standard HTML protocol and is also inefficient. This can be problem for your website as it may not render properly in IE6. A solution to this is to display a warning message to IE6 users, on the top of your webpage, informing them that their browser is old and they should upgrade it immediately.

To do so append the following script just after the <body> tag -

<!--[if lt IE 7]>

<div style="width: 100%; border: 1px solid #F7941D; background: #FEEFDA; text-align: center;&quot;&gt; clear: both; height: 75px; position: relative;">

<div style="width: 100%; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;">

<div style="width: 10%; float: left;"><img alt="Warning!" src="ie6nomore-warning.jpg" /></div>

<div style="width: 90%; float: left; font-family : Arial, sans-serif; ">

<div style="font-size: 14px; font-weight: bold; margin-top: 12px;">You are using an obsolete and unsupported browser. For better user experience please switch to <a href="http://www.google.com/chrome">Chrome</a>, <a href="http://getfirefox.com">FireFox</a>, <a href="http://www.opera.com/download/">Opera</a>, <a href="http://www.apple.com/safari/">Safari</a> or <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Internet Explorer</a>.

Thanks!</div>

</div>

</div>

</div>

<![endif]-->

The code between <!--[if lt IE 7]> and <![endif]--> tags will be interpreted by only Internet Explorer and will be ignored by other browsers. If the Internet Explorer version is less than 7 then the code between the these tags will be executed and a warning message will be displayed to the user. This warning message will look like this -  

Warning!
You are using an obsolete and unsupported browser. For better user experience please switch to Chrome, FireFox, Opera, Safari or Internet Explorer. Thanks!

 

You will also need to download ie6nomore-warning.jpg from here and upload it to your server and change the image path in the above code accordingly. Additionally you can change the warning message if you wish to. It includes download links for all modern browsers. Personally I feel that its better to ask your users to upgrade their browsers instead of providing support for IE6 which has now become obsolete.

Tags: