View Single Post
Old 11-23-2011, 04:32 AM   PM User | #4
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
anything with !important will override anything of the same CSS style and works all the way down to ie6!

here's a little snippet that is ordered from weakest to strongest!
Code:
.imALittleWeakClass {
   color: #111;
}
#imABigStrongId {
   color: #222;
}
.imALittleWeakClassMadeStronger {
   color: #333 !important;
}
#imABigStrongIdMadeEvenStronger {
   color: #444 !important;
}
as you can see id is stronger than class, but with !important, a class is stronger than an id! Nonetheless, an id with !important is GOD!

initially, ids override classes, but even a class can override an id with !important!
this allows for an expanded amount of control over your elements!

Last edited by Sammy12; 11-23-2011 at 04:38 AM..
Sammy12 is offline   Reply With Quote
Users who have thanked Sammy12 for this post:
kimmi_baby (11-23-2011)