Browser Support for CSS | Page 2 | WebReference

Browser Support for CSS | Page 2


[previous] [next]

Browser Support for CSS

Ancient Browsers

Ancient browsers are those that existed before Cascading Style Sheets were even a glimmer in the W3C's collective eye. Netscape 3 is the classic example of an older browser, and it does exactly what it's supposed to do: It ignores CSS entirely. If you use Netscape 3 to visit a Web page styled with CSS, the browser doesn't notice a single rule. The style sheet doesn't even load.

This is actually ideal behavior for older browsers; with CSS designed for backwards compatibility, most CSS-based websites should still work, although they may be somewhat boring in appearance. Because Netscape 3 is ignoring all Cascading Style Sheets rules, you know exactly what it will do with them; there's no guesswork necessary on the part of the author. You don't have to do anything special to support these types of browsers, except for testing your designs to see whether they still function without CSS.

Some ancient browsers are:

  • Lynx
  • Mosaic (no longer in widespread use)
  • Netscape 3 (no longer in widespread use)

Broken Browsers

The worst kind of browser is one that is simply broken when it comes to CSS, despite whatever claims the provider makes to standards compliance. A broken browser is one that, when given perfectly legitimate Cascading Style Sheets rules, doesn't present a Web surfer with anything useful, but instead displays a mishmash of styles where information gets lost. The difference between an older browser and a broken browser is that older browsers don't try to display CSS, and broken browsers try and fail horribly.

Internet Explorer 3 was the first browser to implement any CSS, but it did an overall bad job at it, based in part on the fact that they coded to a specification that was still being written at the time. When the final version of CSS Level One came out, it was quite different from Internet Explorer 3's attempt to implement CSS support.

Fortunately, Internet Explorer 3 has almost passed into memory, replaced by newer versions of Internet Explorer that are closer to the CSS specification, meaning that the buggy CSS implementation in Internet Explorer 3 really isn't a factor in current CSS usage.

To account for the broken browsers out there, it's necessary to understand how they're broken and what happens when you give each browser some CSS rules that it doesn't understand. In some cases, the broken browser just ignores your CSS, as is the case with a limited or older browser; in others, it may do something horribly wrong.

There are two approaches to dealing with broken browsers. First, you can code around the problems by using a filter or other browser hack to prevent the browser from mangling your page. And second, for some browsers that are just so old that few people use them any more, you could just no longer support those browsers on your website.

The list of broken browsers includes:

  • Internet Explorer 3 (no longer in widespread use)
  • Netscape 4 (no longer in widespread use)
  • Various minor releases of browsers that had serious bugs, and thus are no longer available

Quirky Browsers

Between the downright broken browsers and the compliant ones is a category of Web browsers that have the best intentions, but just don't get it quite right. These browsers are generally compliant but have serious problems that come out when you start doing complex styles—for example, when using CSS to lay out a Web page. We'll call these quirky browsers.

Unlike broken browsers, these are still in use, especially Internet Explorer versions 5 through 6. This means that as a Web designer you can't just ignore them, nor can you simply lay the blame on the programmers who created the browser. It's your website (or your employer's, or your client's), and you need to take responsibility for how it appears in common browsers.

The way to deal with these browsers is to understand their quirks and bugs and work around them. One strategy is to use only "safe" CSS code in your designs, even if that limits the effects you can produce in more fully compliant browsers. Another method for dealing with a quirky browser is to use filters and other browser hacks to tailor the style rules given to that browser; techniques of this sort are described in Hour 24.

Some browsers with quirks include:

  • Internet Explorer 6, 5.5, and 5
  • Internet Explorer for Mac (no longer in widespread use)
  • Opera 5 and 6 (no longer in widespread use)
  • Netscape 6 (no longer in widespread use)

[previous] [next]

URL: