Archive for May 9th, 2009

Override Inline CSS – I had no idea!

Just came across this link via dZone.

<div style="background: red;">
    The inline styles for this div should make it red.

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.