开发者

Nested selector of CSS doesnt work in IE8 but works in IE6?

Hi The below code works fine in IE6 but not in IE8 may i know what is causing the problem ?

<html>
<head>
<style type="text/css">
  .dataSection {
     font-weight:bold;
     color:#fff;font-family:Verdana, Arial, Helvetica;
     text-align:left;
     background-color:#004E82;
     padding:2px 4px 2px 2px;
  }
  .dataSection.header {
     font-weigh开发者_运维问答t:bold;
     color:#fff;
     font-family:Verdana, Arial, Helvetica;
     text-align:left;
     background-color:#004E82;
     padding:2px 4px 2px 2px;
  }
</style>

</head>
<body>
<table class="DataSection">
<tr>
  <td class="header">Summary</td>
</tr>
</table>
</body>
</html>


Your CSS is wrong, it just seems to work in Internet Explorer 6 because it has a bug whereby it treats .foo.bar as .bar

You are looking for .foo .bar. i.e. "An element with class bar that is a descendent of an element with class foo" as opposed to what you have, which is "An element with both class foo and bar such as <div class='foo bar'>".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜