Wednesday, February 07, 2007

CSS - Conditional comments

Like anyone who looks after any web sites, CSS rendering engine bugs are a bane in my life. Tweaking the CSS code to look OK for all visitors' browsers is a right pain. The usual way to approach the problem is either to try to get a single stylesheet that looks adequate in all browsers, while possibly not optimal in any, or to use various CSS hacks such as partially formed comments. These exploit known bugs in, e.g. the IE 5.5 CSS parser, to present different styles to different browsers. Thanks to the nice people at Virgin Radio, today I came across a rather cleaner solution: CSS - conditional comments. Very useful. Thanks ant!

No comments: