[thelist] 2 CSS Questions

aardvark roselli at earthlink.net
Fri Aug 16 13:13:00 CDT 2002


> From: "Brian W. Reaves" <brian at brianreaves.com>
>
> 1)       I want all header tags to be referenced by a single class. Do
> I have to create an entry for each H tag:
>
> h1, h2, h3, h4, h5, h6, h7.mail {
> background: #fff;
> color: #000;
> font-family: verdana, helvetica, arial, "sans serif";
> }

so you want all <h#> to look the same provided they have the
same class?  try this...

.MailHeader	{	background: #fff;
			color: #000;
			font-family: verdana, helvetica, arial, "sans serif";
}

<h# class="MailHeader">Header</h#>

after all, if you're just going to use it on <h#> elements, you don't
need to be specific... if you were going to use that class all over
the place, then affixing it to a particular element would be good...

> 2)       I think I need to use a contextual Selector but I do not know
> how to create it when using more than one tag. This situation uses a
> class tag in a div, but their are td & p tags within the div which I
> do not have access too:
>
> DIV.mail td p {
> background: #fff !important;
> color: #000 !important;
> font-size: 12pt !important;
> font-family: verdana, helvetica,  arial, "sans serif";
> padding: 10px !important;
> }

if the div has a class of mail, then you can get everything in the
<td> like this:

div.mail td { ... }

if you want the <p> only in the <td> in the <div class="mail">:

div.mail td p {...}
div.mail p {...]

if you want all <td>s and <p>s in the <div class="mail":

div.mail td, div.mail p {...}



--
Read the evolt.org case study
Usability: The Site Speaks for Itself
http://amazon.com/exec/obidos/ASIN/1904151035/evoltorg02-20
ISBN: 1904151035



More information about the thelist mailing list