HighDots Forums  

newbie question

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss newbie question in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default newbie question - 10-05-2003 , 03:54 PM






<style>
td { ... }
td.a { ... }
</style>

td.a style derives from td
Now I want a style which derives from td.a
How can I write this? (td.a.b ?)

How can I use it in:
<td class="???">


Thanks!



Reply With Quote
  #2  
Old   
Stan Brown
 
Posts: n/a

Default Re: newbie question - 10-05-2003 , 07:07 PM






In article <blq09k$31i$1 (AT) nic (DOT) grnet.gr> in
comp.infosystems.www.authoring.stylesheets, <- Chameleon ->
<cham_gss (AT) hotmail (DOT) NOSPAM.com> wrote:
Quote:
style
td { ... }
td.a { ... }
/style

td.a style derives from td
No, it doesn't. I can see why you might think that, but it's a
fundamental misunderstanding. No shame in that: we all had to learn.
But disabuse yourself of the notion that styles "inherit" in that
way, or you'll be constantly frustrated.

First assuming that the two styles don't mention the same property,
you have two possibilities: _Every_ <td> element gets the first set
of properties, and <td class="a"> elements also get the second set
of properties.

Now if there's overlap, for instance if you have td {color:#000} and
td.a {color:#800}, then <td class a> will be in brick red and all
other <td>s will be in black.

Quote:
Now I want a style which derives from td.a
How can I write this? (td.a.b ?)
No. If you write "td.a .b" that means any element of class b that's
within a <td class="a"> at any level of nesting.

If you want some properties for both <td class="a"> and <td
class="b"> and others for only <td class="b">, write it this way:

td.a, td.b {color:#000}
td.b {font-weight:bold}

It's possible to define "utility classes" and apply more than one
class to an element: <td class="a b c d e"> but browser support is
poor.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.