Wednesday, March 25, 2009

Stupid IE

If you want to include a CSS hack for IE in your CSS then you must use /* IE Browsers */ comments, which is nothing like creating all your styles in a separate CSS and hacking it in your HTML

In your HTML it looks kind of like this: (please excuse the weird spacing around the comments, Blogger has issues with pointy brackets)
< ! --[if IE]>
Special instructions for IE here
< ! [endif] -- >
vs the much superior CSS inline:
img {
bottom: -1px; /* IE Browsers */
bottom: 0px;
}
See the if else?? No? Me either, but this took me a few days so I should probably write it down.

No comments: