HomePage | RecentChanges | Preferences | Newbie Help
Category CSS FAQ
Why does my stylesheet not work in Netscape 4.x?
Netscape 4.x has notoriously buggy support for stylesheets (CSS). This means that not only does it ignore some of the rules, but it actually gets things wrong, and can make a page viewed with a "properly-coded" stylesheet utterly unreadable.
For this reason, some people choose to hide the stylesheet from Netscape 4.x using the "@import hack" (which relies on a bug, like most hacks). This also hides the stylesheet from any browser which does not support this way of importing stylesheets.
This solution was made popular in certain circles after the [Browser Upgrade Initiative] was launched by the [WaSP], mainly through the publication of an [evangelisation article] at http://alistapart.com.
- Sorry, but this is entirely wrong. The @import and @media hacks have been known and popular for several years. ALA is a late adopter, really.
- Sorry back: ALA did contribute to making this solution popular amongst a certain crowd. That doesn't mean I'm saying they invented it! Isn't "in certain circles" clear enough?
- Well, sorry to you too. (Hehehe, if we keep this up we'll have a page full of "sorry" ;-]). Which "certain circles" are you referring to? Zeldman is what I'd call a "presentationalist" - the designer has to be in control, and anything goes as long as it looks nice. That's why these people were so fond of the traditional table-based layout with spacer gifs etc. Now they're trying to do the same with CSS. That's why they want everybody to use the browsers they designed for: because it looks like garbage in any other browser. IMHO it's "best viewed with" all over again, this time with the excuse of standards support. But let's not get into this old debate again...
- Sorry *wink* (we might have to delete all this at some point!), but it's hard not to get into the debate when you make it so tempting! What's wrong with "best viewed in a standards-compliant browser, and perfectly readable in anything else"?
- There is no such thing as a standards-compliant browser, is what's wrong. -- jer
- Thanks for clearing that up.
- Coming back to my initial statement, I do not think it is wrong to say that the BUI made this solution popular amongst a certain crowd. The utility/validity/correctness of the BUI or Zeldman's position in all this is not what I'm talking about here. -- steph
The campaign basically prones (?) advancing to "Full Throttle CSS" (see in: http://www.zeldman.com/lectures/css/), and by abandoning the practice of deliberately writing bad markup to force pixel-perfect display in non-compliant old browsers, encouraging users to [upgrade] to newer, standards-compliant browsers.
To the dismay of the initiators, the campaign was disparged by many for its (early) use and advocation (?) of a browser redirection script to prevent non-css-capable browsers (mainly, Netscape 4.x!) from viewing standards-compliant pages. The "redirection script" was primarily intended to ensure the impact of the campaign by its use at http://alistapart.com/, and to spare the "designer crowd"'s feelings (who would understandably not appreciate letting people view their art with no stylesheet!), according to at least one misinterpretation based on nothing but rage. It was unfortunately understood by some as a role-model for Joe Webmaster's behavior, which it is definitely not while others wondered when this paragraph would end and if it had ever made sense.
Another more Netscape-specific solution (if you want to hide your stylesheet from the "monster"!) is to use a linked stylesheet with the attribute media="all".
Some people have also learnt to code for Netscape 4.x bugs, and now they are having trouble with Netscape 6. Netscape 6 has good support for CSS.
Why is this "hilarious?" Doctype switching enables browsers to support standards while providing backward compatibility for sites that require it. This is hilarious?
- I prefer "nonsense", or "harmful". A doctype declaration cannot even say what the document is, who gave them the goddamn right to invent a new meaning for it? Using it to assume that a document would benefit from quirks mode is bogus, you could as well assume that for a document hosted on an IIS server. Eric Bednarz
Problems with split images and tables in Netscape 6: