Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: Re: Help With CSS


Message #1 by "Hugh McLaughlin" <hugh@k...> on Wed, 1 Aug 2001 01:21:39
> Yes, that's the way it is supposed to work. By default, an element 
inherits 
> the values of its parent, unless the child overrules those values.
> 
> Within that context, there are more overruling rules: the style=.... 
> attribute overrules styles defined in the <style> section. Styles in the 
> <style> section on their turn overrule styles in an external stylesheet.
> 
> Apparently, tables are different; that is, a <td> is different. Somehow 
> (not sure where in the specs this is defined) the <td> does not inherit 
> values of its parents.
> 
> Take a look at the following example:
> 
> (.... Your style definition here ...)
> 
> <span class="Address">
> Number 1
> 
> <p>Number2</p>
> 
> <h2>Number3</h2>
> 
> <div>Number4</div>
> 
> <table>
> <tr>
>          <td>Number5
>          </td>
> </tr>
> </table>
> </span>
> 
> In the example above, Number 1 through 4 WILL inherit the correct 
values. 
> Only the <td> doesn't.
> 
> For more info, check out CSS Level 1 and 2 at www.w3.org
> http://www.w3.org/TR/REC-CSS1
> http://www.w3.org/TR/REC-CSS2
> 
> 
> And if someone knows why the <td> element doesn't inherit correctly, 
please 
> tell us.
> 
> Imar
> 
> 
> 
> 
> 
> 
> >Thanks Imar.  I guess the bottom line it that I don't understand the
> >inheritance issue.  Am I right in assuming that CSS works completely in 
a
> >hierarchial fashion, such that each parent or corresponding child must
> >have the attribute assigned or it will take the default value?
> 
Thanks Imar.  That helps larify it.  I appreciate your help.

  Return to Index