查看完整版本: CSS BUG:IE6中奇怪现象

tension 2008-3-16 13:21

CSS BUG:IE6中奇怪现象

CSS BUG:IE6中奇怪现象:当ID与Class组合使用的时候在IE6下无法正常显示。

CSS代码:

[code]#f{ font-size:20px}
#f.a{color: red;}
#f.b{color: black; font-size:50px}
#f.c{color: blue;}
#f.d{color: orange;}[/code]

HTML代码:
[code]<div id=”f” class=”a”>a</div>
<div id=”f” class=”b”>b</div>
<div id=”f” class=”c”>c</div>
<div id=”f” class=”d”>d</div>
[/code]

幻想一下IE会把它解释成什么?

看下面的运行效果:
[html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>www.twocity.cn</title>
<style type="text/css">
#f{ font-size:20px}  
#f.a{color: red;}  
#f.b{color: black; font-size:50px}  
#f.c{color: blue;}  
#f.d{color: orange;}
</style>
</head>
<body>
<div id="f" class="a">a</div>  
<div id="f" class="b">b</div>  
<div id="f" class="c">c</div>  
<div id="f" class="d">d</div>
</body>
</html>
[/html]

  事实上IE6只识别了#f.a{color: red;} 这一句,而后面三句都忽略了。 对此我们只得表现出无语并表示不理解。 (此现象在Firefox、Opera、IE5中显示正常):@
页: [1]
查看完整版本: CSS BUG:IE6中奇怪现象