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 Women's Cotton T-Shirt (in 22 colors)Don't Mess With Me... Programmer on Women's Cotton T-Shirt (in 22 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.
Don't Mess With Me... Programmer on Long Sleeve Adult & Youth Cotton T-Shirt (in 24 colors)Don't Mess With Me... Programmer on Long Sleeve Adult & Youth Cotton T-Shirt (in 24 colors)100% preshrunk cotton; double-needle stitching throughout; rib knit neck; shoulder-to-shoulder tape; heather grey is 90% cotton, 10% polyester; ash is 99% cotton, 1% polyester; rib knit neck and cuffs.

If you're new here, you may want to subscribe to the mailing list to get notifications of new post and a virtual tour of past topics. Thanks for visiting!

Most Commented Post

3 Responses to “Override Inline CSS – I had no idea!”

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor