Iqb*_*han 6 html css internet-explorer conditional-comments
我想在IE中使网站看起来更好,所以我决定使用条件评论.所以我使用这个条件注释链接到样式表.
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="IEstyle.css" />
<![end if]-->
Run Code Online (Sandbox Code Playgroud)
这不起作用,它将使用默认样式表或它将显示一个空白页面.那么我在某处读到评论是这样的.
<!--[if !IE]>-->
<link rel="stylesheet" type="text/css" href="IEstyle.css" />
<!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)
所以我尝试了它,它完成了与另一个完全相同的事情,但-->显示在页面上.我仍然是一些新的HTML,任何帮助都会很好.
以下是评论的正确格式:
<!--[if IE ]>
Special instructions for IE here
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
这是一个 NOT IE 评论:
<!--[if !IE ]>
According to the conditional comment this is not IE
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
来源: http: //www.quirksmode.org/css/condcom.html
编辑:刚刚注意到他们的“不”示例是错误的。我已经更正了。
| 归档时间: |
|
| 查看次数: |
11660 次 |
| 最近记录: |