why don't BODY style attributes get inherited by tables?

by Bennett Haselton <bennett(at)peacefire.org>

 Date:  Wed, 27 Jun 2001 20:11:41 -0700
 To:  hwg-style(at)hwg.org
  todo: View Thread, Original
<html>
The page at<br>
<a href="http://www.w3.org/TR/REC-CSS2/cascade.html" eudora="autourl">http://www.w3.org/TR/REC-CSS2/cascade.html</a><br>
<br>
says that certain style properties are inherited by children from their
parents.&nbsp; However, it doesn't say how to determine if a given
element in an HTML page is a child of another.&nbsp; Is there a reference
on how to do that?&nbsp; I figured it would be intuitive most of time (TD
is a child of TR and TR is a child of TABLE, etc.) but consider the
following case:<br>
<br>
I would have thought that a TD is a child of a TR, a TR is a child of a
TABLE, and that a TABLE is a child of the enclosing BODY tag --
right?&nbsp; However, if you view the following HTML page in either IE
5.5 or Netscape 4.75 for Windows, the style that you set for the BODY tag
does not apply to the text inside the table cell.&nbsp; Following the
logic of the CSS specification, I would have figured that the TD is a
child of the TR, the TR is a child of the TABLE, and the TABLE is a child
of the BODY, hence inheritable attributes (like font size) should get
passed from BODY all the way down to the text inside the TD, and it
should be displayed the same as text outside the TD.<br>
<br>
Do I have some basic misunderstanding of how inheritance is working
here?<br>
<br>
&gt;&gt;&gt;<br>
&lt;html&gt;<br>
&lt;head&gt;<br>
<br>
&lt;style type=&quot;text/css&quot;&gt;<br>
<br>
BODY {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>font-size
: 15pt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>font-weight
: normal<br>
}<br>
<br>
&lt;/style&gt;<br>
<br>
&lt;/head&gt;<br>
&lt;body&gt;<br>
<br>
&lt;table&gt;<br>
&lt;tr&gt;<br>
&lt;td&gt;<br>
<br>
This text is inside the table.<br>
<br>
&lt;/td&gt;<br>
&lt;/tr&gt;<br>
&lt;/table&gt;<br>
<br>
This text is outside the table.<br>
<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
&gt;&gt;&gt;<br>
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>-Bennett<br>
<br>
<div>bennett(at)peacefire.org&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.peacefire.org/" EUDORA=AUTOURL>http://www.peacefire.org</a></div>
(425) 649 9024
</html>

HWG hwg-style mailing list archives, maintained by Webmasters @ IWA