迫不得已! ! 仅仅针对IE浏览器的样式,尤其是IE8及以下

IE10不会起作用,IE9,8,7,6,5都可以 

<html>
    <head>
        <title>IE打开就是蓝色背景,白色的字体</title>
        <!--[if IE]>
            <style>
                body { background-color: blue; color: #fff; }
            </style>
        <![endif]-->
    </head>
    <body>
        IE打开就是蓝色背景,白色的字体
    </body>
</html>

 

 

<!--[if IE 6]> 
    可以把样式写在这中间
<![endif]--> 
只有IE6版本可见 
<!--[if lte IE 6]> 
<![endif]--> 
IE6及其以下版本可见 
<!--[if gte IE 6]> 
<![endif]--> 
IE6及其以上版本可见 
<!--[if IE 7]> 
<![endif]--> 
只有IE7版本可见 
<!--[if lte IE 7]> 
<![endif]--> 
IE7及其以下版本可见 
<!--[if gte IE 7]> 
<![endif]--> 
IE7及其以上的版本可见 
<!--[if IE 8]> 
<![endif]--> 
只有IE8版本可见 
<!--[if lte IE 8]> 
<![endif]--> 
IE8及其以下的版本可见 
<!--[if gte IE 8]> 
<![endif]--> 
IE8及其以上的版本可见 
<![if !IE]> 
<![endif]> 
除了IE以外的版本

 

posted @ 2018-09-26 14:05  WhoKnows1  阅读(746)  评论(0编辑  收藏  举报