[thelist] CSS Layout questions

Arlen.P.Walker at jci.com Arlen.P.Walker at jci.com
Tue Jun 11 10:07:00 CDT 2002


>1) What is the prevailing way of dealing with classes? Should I keep my
character formatting stuff
>separate from my content formatting code?

Go ahead and blend the two. The biggest issue you might run into is if you
use the "line-height" attribute. Some browsers apply this to images in a
funky way, so if you're going to play with that one, do it separately.

>2) I don't understand a couple things about this workaround. a) when
specifying #main twice, does
>the browser read the info from the first, implement it, then add the stuff
from the second
>declaration below it?
>
>            #main {
>                  }
>
>            #main #menu {
>                        }

The first set defines the style for the class "main." The second defines
the style for the class "menu" as encountered within a block styled with
"main." It doesn't affect anything styled as "main" unless it is *also*
styled as menu, and likewise will not affect anything styled with "menu"
unless located within a block styled with "main."

Example:

CSS:
#fred { color:red }

#george { color:purple }

#fred #george { color:grey }

#george #fred { color:magenta }

HTML (in the interests of not offending html-enabled email clients, I have
substituted the entity name for the "less than" symbol in the following):

<div class="fred">
<p>This is red</p>
<div class="george">
<p>This is grey</p>
</div>
</div>
<div class="george">
<p>This is purple</p>
<div class="fred">
<p>This is magenta</p>
</div>
</div>

Have fun,
Arlen
Chief Managing Director In Charge, Department of Redundancy Department
DNRC 224

Arlen.P.Walker at JCI.Com
----------------------------------------------
In God we trust; all others must provide data.
----------------------------------------------
Opinions expressed are mine and mine alone.
If JCI had an opinion on this, they'd hire someone else to deliver it.




More information about the thelist mailing list