简体   繁体   中英

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

<!--[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

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");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM