This web site is about Cascading Style Sheets as a means to separate the presentation from the structural markup of a web site, and it will help you answer some of those frequently asked Questions, explains some of the Basics of CSS, gives you tips and tricks for tackling the problems with Netscape 4, offers you a tutorial about Positioning with CSS (CSS-P, web design without tables). There is also a page with interesting Links.
This page uses CSS to present the content in the best possible manner. If you can see this message, then CSS (or JavaScript) is not enabled in your browser, and the page will not appear as the designer intended.

CSShark - Netscape Issues: 2 Stylesheets
The CSS Know-How Site


CSS and Netscape 4.xx Issues

Why two Style sheets?

Netscape 4.xx is now more than 4 years old and has been developed when CSS was in the planning stages, and it shows! That means that NN 4.xx does not correctly interpret or render many simple CSS styles. Internet Explorer, on the other hand, has been consistently upgraded over that time. This means that many of the styles that Netscape 4.xx does not support will be supported in IE. One way to have a site styled the way you want it and keep NN 4.xx happy is to use external style sheets, with a trick which will be explained soon.

The syntax for linking an external style sheet is:

<link rel="stylesheet" href="Style.css" type="text/css">

It makes sense to use two different external styles - one for IE and NN6, the other one for NN4.xx. In doing so, you could adapt your font sizes, or background properties, or the other styles that NN4.xx has problems with.

To do that you can use the fact that NN 4.xx does not recognize the @import.
Therefore you link two style sheets:

<link rel="stylesheet" href="StyleNN.css" type="text/css"> 
<style type="text/css"> 
@import url(Style.css); /*IE and NN6x styles*/

Explanation: NN4.xx does not recognize the @import, so it uses the <link> style sheet. IE and NN6 merge both stylesheets, but by placing the @import sheet after the <link> style, you give it more importance, therefore IE and NN6 will give you the styles in the @import.

 Back to the Top 

You have to remember to use the same selectors and properties in both style sheets. If you declare a selector or property in the linked stylesheet and omit this in the imported sheet, IE and NN6 will take this selector or property with the corresponding value from the linked sheet.

The easiest way to have two style sheets is to start out with one sheet where you declare the styles, and then copy this sheet, rename it and change or delete the values where NN 4.xx has problems.

Important: If NN 4.xx can't find the external CSS file, the page will not be rendered properly.

Other topics:

Home   • CSS FAQs   • Basics   • NN4 Issues   • CSS-P   • Links   • Books  
Content, Design and Programming © 2001 by MaKo from Orion HiTek, Inc.. All rights reserved worldwide.