This site is designed for accessibility. Content is obtainable and functional to any browser or Internet device. This site's full visual experience is available in a graphical browser that supports web standards. Please consider upgrading your web browser.

How to hide a Style Sheet from Navigator 4.x

and Explorer 4.x for Windows and Explorer 4.5 for Macintosh

Use:

@import url("...")

Navigator 4.x , Explorer 4.x for Windows, and Explorer 4.5 for Macintosh do not understand @import and will ignore it.

@import is a directive that instructs the web browser to load an external style sheet and use its styles in the rendering of the HTML document. The only real differencein using @import and LINK, is in the actual syntax of the command and its placement. As you can see, @import is found inside the STYLE container. It must be placed there, before the other CSS rules, or else it won't work at all.

<STYLE TYPE="text/css">
@import url("styles.css"); /* @import comes first */
H1 {color: gray;}
</STYLE>

Like LINK, there can be more than one @import statement in a document. Unlike LINK, however, the style sheets of every @import directive will always be loaded and used in compliant user agents like Mozilla 0.9.x (Netscape 6.2.x).

I sometimes use @import so NS4.x will see a .webstandards message.

I used the declaration:

.webstandards {display : none;}

in my @import style sheet.

Then in the body I put:

<p class="webstandards"><strong>This site is designed for accessibility. Content is obtainable and functional to any browser or Internet device. This site's full visual experience is available in a graphical browser that supports web standards. Please consider<a href="http://www.webstandards.org/upgrade/"> upgrading your web browser.</a></strong></p>

It seems to work well. The message is hidden from CSS compliant browsers as long as CSS is turned on. Older browsers show the message. No need for javascript. Non-compliant browsers like NS 4.7 just gets a vanilla site. They don't have the chance to get all of the styles wrong. This method lets everyone access the content, but alerts people using older browsers to the availability of standards compliant ones. Compliant browsers get the styles as authored.

Zeldman explains the whole invisible object method on his site.