views:

30

answers:

1

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-weight: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>
+4  A: 

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'>".

David Dorward
It is indeed the last class mentioned.
ajm
@ajm - thanks. I deleted my statement of uncertainty.
David Dorward
… and question edited to remove the comments about guesswork now the question has been updated.
David Dorward