Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is CSS inheritance not working for me in IE8?

I have a situation that I am looking at where certain CSS properties will not be inherited. This revolves around tables and IE8. Using the sample HTML below I cannot get the text within the table to inherit the green colour.

This works in Firefox and Chrome, but not IE8 and from reading up this seems to have always been a problem in IE but was meant to be working in version 8 from what I read.

I have tried to specify the inherit value everywhere possible, but to no avail so the question is whether the CSS inheritance support in IE8 is buggy, or am I missing something?

I don't want answer changing inline CSS to be classes and I certainly dont wan't any comments on tables as this all stems from building and designing HTML emails where inline CSS and tables are essential.

<html>
<head></head>
<body>
<table style="color: green;">
  <tr>
    <td>
      <span>Span</span>
      <p>Paragraph</p>
      <div>Div</div>
      <table style="color:inherit;">
        <tr>
          <td>Table</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
like image 896
rrrr-o Avatar asked Apr 08 '10 13:04

rrrr-o


1 Answers

You're right, this is pretty odd, although I find that adding a valid doctype solves the problem. http://jsbin.com/etuti/2

like image 113
graphicdivine Avatar answered Sep 19 '22 03:09

graphicdivine