The Good Life... a weblog about life, technology, and the Opera Web browser

Netscape 4.x is a horrible

Netscape 4.x is a horrible browser to code web pages using CSS for. It seems to have more bugs than correct functionality. Don't fret, though; there are plenty of resources available to aid you in working around the bugs and getting a web page that still works great in CSS-compliant browsers. The CSS Problems in Netscape FAQ over at All My FAQs is the most complete resource I've found to answer questions about Netscape 4.x's CSS support and work-arounds for its bugs.

Currently, there isn't a simple, standard-compliant, scriptless means of passing a separate stylesheet to Netscape 4.x and CSS-compliant browsers. I've resorted to using a hack--exploiting a bug in Netscape--to give Netscape 4.x a different stylesheet. I first got the idea from another web log with information on how to hide certain CSS from Netscape 4.x, though it didn't hide that CSS from CSS-compliant browsers. The idea is to use the non-compliant src attribute of LINK instead of the standard href attribute to reference the stylesheet. Only Netscape 4.x recognizes src, so there's no risk of its special stylesheet contaminating your stylesheet for standard-compliant browsers. Cool.

Unfortunately, none of the HTML where I'm using this hack validates now. Oh well. That's a necessary evil considering I have to support Netscape 4.x.