Re: Syntax query on styles

by "Darrell King" <darrell(at)webctr.com>

 Date:  Mon, 15 Apr 2002 07:08:14 -0400
 To:  <hwg-basics(at)hwg.org>
 References:  S0026260871 bert S00262608712 S00262608713 hilma
  todo: View Thread, Original
Not sure if I understand the question correctly, but I'll try...:).

If, after redefining tables in the stylesheet, you apply a style to a table
in your code, that style will take precedence over the table redefinition
for the table in question.

It's a matter of nesting.  The innermost rule applies in a conflict.  This
is represented by the word "Cascading" in Cascading Style Sheets.  The
authority cascaded down the nesting hierarchy.

<style class='text/css'>
p { color: #FF0000; } /* no leading dot */

.bluefont { color: blue; } /* classes have leading dot */
.blackfont { color: #000000; }
</style>

<p>this sentence is red.</p>

<p class='bluefont'>This sentence is blue.</p>

<p class='blackfont'>This sentence is black.</p>

<p class='bluefont' class='blackfont'>This paragraph is illegal because it
has 2 class attributes.</p>

<p class='bluefont' style='color:yellow'>This sentence is yellow.</p>


Remember that, when declaring a class in a stylesheet, you must precede the
class name with a dot. When redefining an HTML tag, you do not precede the
tag name with a dot.

D


----- Original Message -----
From: "Hilma" <Hilma(at)hilma.freeserve.co.uk>

"I've got 3 classes.
Within myClass1, I  want all <table>s to have AppearanceA and all <p>aras to
have AppearanceB
Within myClass2, I  want all <table>s to have AppearanceC and all <p>aras to
have AppearanceA
Within myClass3, I  want all <table>s to have AppearanceD and all <p>aras to
have AppearanceB
"

It is the combination of element-styles and named-styles that has confused
me, as well as knowing which css attribute 'maps' to which element and
element attribute.

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA