user2028856
user2028856

Reputation: 3183

Hide CSS and HTML from ie6 users?

I'm trying to force my ie6 users to upgrade to modern browsers when viewing my site. Since it's too time consuming to modify everything to work for ie6. Since everything looks broken I'd rather just hide the whole CSS + HTML and only display a pop up browser. My question is, how do I set all elements to not display if a user is using ie6?

Thanks

Upvotes: 2

Views: 139

Answers (2)

BeWarned
BeWarned

Reputation: 2338

You could add this at the top of your pages in the head element to redirect the user to specific page.

if (navigator.userAgent.match(/MSIE/i)) {
    document.location.replace("/ie6warning.html");
}

Upvotes: 0

Darren
Darren

Reputation: 70728

<!--[if IE 6]>
    Special instructions for IE 6 here
<![endif]-->

Example:

<!--[if IE 6]>
    <style type="text/css">
         #browserWarning { display:block; }
         /* hide content here */
     </style>
<![endif]-->

http://www.quirksmode.org/css/condcom.html

Upvotes: 5

Related Questions