Override Inline CSS – I had no idea!
Just came across this link via dZone.
http://css-tricks.com/override-inline-styles-with-css/
<div style="background: red;">
The inline styles for this div should make it red.
</div>
We can fight that with this:
div[style] {
background: yellow !important;
}
It doesn’t work in IE6, if you care. But the places where I’ve needed this trick, I don’t care.
Other Related Items:
Don't Mess With Me... Programmer on Long Sleeve Women's Cotton T-Shirt (in 9 colors)100% preshrunk heavyweight cotton; double-needle stitching throughout; seamless rib at neck; shoulder-to-shoulder tape; heather grey is 90% cotton, 10% polyester; fashion cut; 5/8" rib collar; fitted tapered sleeve.
Bdg Bdgasp.net Publishing Mastering Asp.net [windows/macintosh]Mastering asp.Net gives new programmers the ability to use this incredible new tool as if they were an old pro! master the flow and management of your data with this powerful learning tool!











Yeah the !important keyword is nice for this. Just remember that you need to add the !important keyword to every css property that you wish to override
div[style] {
background: yellow !important;
color: blue !important;
…
}
More information:
http://reference.sitepoint.com/css/importantdeclarations
http://reference.sitepoint.com/css/specificity
Centralizing the style is much better than skimming through the whole file pasting changes in the style tag. Thank you for the tip, its very useful.
[...] Override Inline CSS – I had no idea! (Dave M. Bush) [...]