Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html IE跨浏览器兼容性问题_Html_Css - Fatal编程技术网

Html IE跨浏览器兼容性问题

Html IE跨浏览器兼容性问题,html,css,Html,Css,我在使用IE时遇到了一个问题。使用firefox时一切都很好,但IE6似乎给css带来了更多麻烦。所以我用 <![if !IE]> <link href="ie6.css" rel="stylesheet"> <![endif]> 解决一个问题,但它不起作用。这个代码有什么错误吗?因为当我更改此css时,IE中没有任何更改。更改: <![if !IE]> ! means not IE there !意思是不在那里 致: 表示如果

我在使用IE时遇到了一个问题。使用firefox时一切都很好,但IE6似乎给css带来了更多麻烦。所以我用

<![if !IE]>
<link href="ie6.css" rel="stylesheet">
<![endif]>

解决一个问题,但它不起作用。这个代码有什么错误吗?因为当我更改此css时,IE中没有任何更改。

更改:

<![if !IE]>      ! means not IE there
!意思是不在那里
致:

表示如果是IE
使用基于IE的CSS。

好吧,你说的是“如果不是IE”。
还要注意的是,您使用的是下层显示的条件注释,这意味着每个浏览器(IE除外)都将包含额外的CSS文件


改用

ie.css是否放在任何其他css文件之后?如果您将它放在常规css之前,它将被覆盖。 它应该是这样的:

 <link href="other.css" rel="stylesheet">
 <![if IE]>
     <link href="ie6.css" rel="stylesheet">
 <![endif]>

试试看


我正在使用这个

<!--[if IE 6]>
this place for your stuff.
<![endif]--> 

尝试使用此条件语句:

<!--[if lt IE 7]>
    <link href="ie6.css" rel="stylesheet">
<![endif]-->


基本上是说,如果浏览器小于IE7,则使用此样式表。对我有效。

@Jay用你使用的更多代码更新你的问题,因为这应该是有效的。虽然你的答案在技术上是正确的,但我不会测试
lte IE 6
;IE不正确:你仍在使用,就像OP一样;除IE之外的所有浏览器都不会将这些内容识别为有效的HTML,只会忽略它们,因此内部的所有内容都不会被忽略。
<!--[if IE 6]>
this place for your stuff.
<![endif]--> 
<!--[if lt IE 7]>
    <link href="ie6.css" rel="stylesheet">
<![endif]-->