Quick Tip 7 – CSS !Important
This isn’t something to use on a regular basis but a very useful tool when you need it.

Another simple tip today, the !important rule in CSS. This little snippet will help you override any rule that is already assigned. For Example:
body { background-color:#000 !important; background-color:#CCC;}
Now the background colour of Black will be assigned over the Grey even though Grey is assigned over Black.
Related posts:
- Quick Tip 5 – Compact CSS
- Quick Tip 6 – CSS Shorthand
- Quick Tip 9 – CSS min height
- Quick Tip 2 – CSS Text Shadow
- Quick Tip 10 – CSS Vertical Alignment
Posted By: Martyn
Hi,
I'm Martyn, the Lead Designer for Web Design GM and really hope you find my existing and upcoming articles useful. Please leave comments below and I will try to respond to any questions as soon as possible.
Tags: !important, CSS
This entry was posted
on Tuesday, March 9th, 2010 at 2:02 pm and is filed under Quick Tips, Web Design.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.