Browser bugs and differences in intrepreting the W3C specifications prevent CSS-based web designs from displaying the same on all web browsers.
CSS hacks take advantage of further browser bugs to hide CSS rules from browsers that mis-interpret them. In effect we use one bug to fix another.
The use of CSS hacks to fix problems is problematic. Future versions of browsers could fix one of the bugs being used, but not the other, so careful choice of hack is needed and they should only be used for old versions of browsers where it is known that neither or both the bugs still exist in the current version.
On a maintenance level it complicates stylesheets. Hacks can be difficult to spot and so should be commented in the code. My technique for doing this is to mark each occurence in the stylesheet with a comment, and for at least the first occurrence provide a link that provides a brief description of the bug and the hack.
The aim of this section is provide permanent links to hacks that I have used within my own code.
Comments
There are no comments yet.
Related articles
- Microsoft forces backward step in email design
- Making RSS pretty using XSL and CSS
- Removing padding from IE buttons
- HTML Star Hack
- Using CSS to produce an image gallery
- Skip navigation
Most recent articles
- FeedGrab and CSVGrab now multiple site compatible
- Rejigging brandnewbox
- Safari 3 beta launched for OS X and Window
- Spot the difference
- Setting up an ExpressionEngine Opensearch plugin