When designing for the Web, developers historically
have used hacks and workarounds to achieve certain effects. The mid-1990s saw a
proliferation of such workarounds, among them single-pixel GIFs, font
tags, and nested tables, to name just a few.
In this new millennium, CSS has allowed web designers to free
themselves from these old workarounds. But although CSS 2 became a
recommendation back in May 1998, only relatively recently have browser vendors
fully implemented the standard in their products. To overcome the bugs in the
browsers that have poor CSS support, web designers have once again resorted to
using hacks and workarounds to achieve their designs.
There are many reasons why old browsers are still in use.
Unlike web developers, most people don't automatically upgrade their browsers
each time a new one is available. They tend to stick with the browser that's on
their computer because it works fine and will get a new browser only when they
purchase a new computer. Also, IT departments in many companies lock down the
systems and prevent individuals from upgrading software applications on their
own.
So even though problems might be solved by using newer versions
of browsers, web developers still need to use hacks or workarounds to deliver
the appropriate presentation to their audience that is unwilling or unable to
upgrade.
This chapter covers techniques on how to deal with browsers
that have spotty CSS support. Included in this chapter are methods to hide
advanced style sheets from Netscape Navigator 4, deal with Internet Explorer
5.x for Window's unique interpretation of the box
model, and more.