Seona Bellamy wrote:
> On 28/11/05, Chad Lindstrom <[EMAIL PROTECTED]> wrote:
> 
>> Add the !important rule.

...

> You're right, it did. Virtual hugs to Chad! *hugs*

!important usually works, and is fine for debugging _and_ hopeless cases.

Advice: better save !important for cases where nothing else works.

Slightly heightened specificity is all that's needed in your case:

div#content div.highlightBox p {
margin: 4px;
}

...may be adjusted to your liking :-)


Learning how to use the cascade[1] to achieve _just_ high enough
specificity is good practicing, and gives us maintainable stylesheets.
( Think I'll need to practice a bit myself ;-) )

The use of nested elements means we can start with the element itself,
the 'p' in your case, and work our way outwards until the style kicks
in. That's proper use of the cascade[1].
We can of course also calculate specificity in order to get it just
right. That may prevent us from using higher specificity in the first
place, and so make it easier to fine-tune details later.

!important is our last option (short of using inline-styles with
!important on top), and overusing it may lead to stylesheets full of
!important just to make them work. Such stylesheets are not easy to
maintain at a later date.

regards
        Georg


[1]http://www.w3.org/TR/CSS21/cascade.html

-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to