I have a general rule which gives all DIVs a background image.
I have one div (with id=\'a\') which I don\'t want it to have the background image.
What css rule do I
div#a {
background-image: none;
}
When background-image: none !important;
have no effect.
You can use:
background-size: 0 !important;
If your div rule is just div {...}
, then #a {...}
will be sufficient. If it is more complicated, you need a "more specific" selector, as defined by the CSS specification on specificity. (#a being more specific than div is just single aspect in the algorithm.)
div#a {
background-image: url('../images/spacer.png');
background-image: none !important;
}
I use a transparent spacer image in addition to the rule to remove the background image because IE6 seems to ignore the background-image: none
even though it is marked !important
.