Gunlaug Sørtun wrote:
> Jim Albert wrote:
>> Is there a way to redefine P but only for a portion of the HTML of a
>>  page?
> 
> If you mean something like...
> 
> p { font-size: small; font-family: verdana, arial, helvetica, sans-serif; }
> #sidebar p {font-size: x-small;}
> 
> ...then that's how all paragraphs are given 'small' font-size, except in
> the sidebar where paragraphs are given 'extra small' font-size.
> 
> All paragraphs in the page are rendered in 'font-family: verdana, arial,
> helvetica, sans-serif;'.
> 
> You use containers with an ID or CLASS you can address the exceptions
> through - in my example a #sidebar in a page.
> 
> 
> 
> You can also use "the nesting depth" in addressing, so...
> 
> p { font-size: small; font-family: verdana, arial, helvetica, sans-serif; }
> 
> ...goes for all paragraphs in the page, except for those paragraphs that
> are inside 2 or more nested divs, as they get...
> 
> div div p {font-size: x-small;}

I think you're pointing me in the right direction with the above.
I can put one or more div tags around the area of html where I want the 
style for P to change.

This is what I had tried but it didn't work:

In my external css file I have:
p { font-size: small; font-family: verdana, arial, helvetica, 
sans-serif; }
.tiny { font-size: x-small; font-family: 
verdana,arial,helvetica,sans-serif; }

I then was hoping I could change the style of P to that of tiny by using 
a div tag like so:

<DIV class="tiny"><P>I was hoping this html would use the "tiny" class, 
but it uses the style for "p"</DIV>

Can I create a class of DIV such that for any P tags within that DIV the 
P tags will look like the "tiny" style?

Am I getting close with the following:

div.tinyp p { font-size: x-small; font-family: 
verdana,arial,helvetica,sans-serif; }

And then use it as such:
<DIV class="tinyp"><P>I hope this html will use the div "tinyp" class</DIV>

> 
> ...and paragraphs inside 4 or more divs can then be given...
> 
> div div div div p {font-size: small;}
> 
> ...the original font-size again - or some other value.
> 
> More complex addressing is possible with more advanced CSS selectors,
> but if you have to support IE6, and maybe even older, then you'll run
> into problems with unsupported selectors.
> 
> regards
>       Georg


-- 
Jim Albert, Software Development
Netrition.com - The Internet's Premier Nutrition Superstore!
http://www.netrition.com/

---------------------------------------------------------------------
This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
information is strictly prohibited. Please note that any views or
opinions presented in this email are solely those of the author and
do not necessarily represent those of the company.
---------------------------------------------------------------------
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to