使用两个条件CSS if语句既不使用样式表 [英] Using two conditional css if statements uses neither style sheet
问题描述
<! - [if!IE]>< link rel =' stylesheet'type ='text / css'href ='/ login / css / correctlogin.css'/><![endif] - >
<! - [if IE]>< link rel ='stylesheet'type ='text / css'href ='/ login / css / ielogin.css'/><![endif ] - GT;
对于!IE
条件注释,正确的格式为<! - [IF!IE]> - > ...<! - <![endif] - >
,因为非IE浏览器对条件注释没有特殊待遇。
<! - [if!IE]> - >< link rel ='stylesheet'type ='text / css'href ='/ login / css / correctlogin.css'/><! - <![endif] - >
<! - [if IE]>< link rel ='stylesheet'type ='text / css'href ='/ login / css / ielogin.css'/><![endif ] - GT;
另见: http://www.quirksmode.org/css/condcom.html
PS。不再支持IE10中的条件注释。
At my wit's end here. Trying to implement two different style sheets, one for IE and one for when it's not IE. In every example I've ever seen this is exactly the way you're supposed to do this. Can anyone spot any mistakes in this? Seems like it should be simple enough.
<!--[if !IE]><link rel='stylesheet' type='text/css' href='/login/css/correctlogin.css'/><![endif]-->
<!--[if IE]><link rel='stylesheet' type='text/css' href='/login/css/ielogin.css'/><![endif]-->
For the !IE
conditional comment, the correct format is <!--[IF !IE]>--> ... <!-- <![endif]-->
, because non-IE browsers do not have a special treatment for the conditional comments.
<!--[if !IE]> --><link rel='stylesheet' type='text/css' href='/login/css/correctlogin.css'/><!-- <![endif]-->
<!--[if IE]><link rel='stylesheet' type='text/css' href='/login/css/ielogin.css'/><![endif]-->
See also: http://www.quirksmode.org/css/condcom.html
PS. Conditional comments are not supported in IE10 any more.
这篇关于使用两个条件CSS if语句既不使用样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!