Syntax query on styles

by "Hilma" <Hilma(at)hilma.freeserve.co.uk>

 Date:  Mon, 15 Apr 2002 08:34:12 +0100
 To:  <hwg-basics(at)hwg.org>
 References:  S0026260871 bert S00262608712 S00262608713
  todo: View Thread, Original
This is possibly a lazy question, but i'm getting confused with styles; so i
hope someone can explain this one to me:

If i want to declare all *tables* with a certain styles, i use

table {
table-attribute1 : what-i-want;  table-attribute2 : what-i-want;
table-attribute3 : what-i-want;
}

And if i want to declare a certain *set of elements* with a certain styles,
i use

myStyle {
attribute1 : what-i-want;  attribute2 : what-i-want;  attribute3 :
what-i-want;
}

then, to have a consistent appearance (and i haven't applied it to the
<body> tag, of course!) i can use:

<p class=MyStyle>
<table class=MyStyle>
<ul class=MyStyle.
.
.
.
.
And those elements that support the style elements as declared in the css
class take that style.
(which may not be *named* the same; this is one of my problems of
understanding:  how can the .css declare different attributes to that of the
element it is applied to, but still work?)

But my big question of today - and it's a little one really - is how do i
say

"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.

But if anyone can explain the above, i might get past this boggy-bit :-)

thanks -

hilma
--x----

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