24 February 2010 0 Comments

CSS – Its !important

CSS styling will always cascade – meaning if you have more than one declaration of the same style – the last one it finds will always be used.

You can override this functionality by using the !important function. A CSS rule which has !important on the end will always be applied no matter where that rule appears in the CSS document.

For example … the following CSS rule will always make sure paragraph text is always red, regardless if the paragraph text colour is changed (to blue) later on in the CSS document.

p { color: #ff0000 !important; }

p { color: #0000ff; }

Tags: ,
Design BumpFacebookDiggDesign FloatMixxRedditStumbleUponTechnoratiTwitterGoogleLinkedInRSS Feed

Leave a Reply