[Top]
More advice for the full screen mode.
   
I list below all topic groups, which I have done according to subjects, which they handle. You can return to this topic group by using this menu and the link Table of topic groups on the top of the each page.
 
 
Search:
[Help]

Netscape 4.x related problems

Passing Netscape 4.x

Giving direct CSS (style="...") is problematic. In one respect it is bad, because certain CSS might crash Netscape 4.x or create some other serious problems. On the other respect it is necessary, because linked CSS doesn't always work. I found the latter matter, when I designed dynamic menus[S]. If the direct CSS doesn't fit for other browser, they can get different CSS in linked files, if declarations have the !important rule. The rule should not however unnecessary overload, because all browser don't accept many times overloaded rules.

In many situations it is reasonable to pass Netscape 4.x. In principle one way to pass Netscape 4.x is to use import rule[S][Pw] and combine it with JavaScript encoding. Because Opera 4.x+ has the mode Identify Mozilla 4.x, the script should have a condition, which prevents Opera to read the CSS for Netscape 4.x. The code should write for example at the following way:

<script language="JavaScript" type="text/javascript">
<!--
if (document.layers) /* No other browsers than Netscape 4.x support this method, when Opera like other browsers skip the block, which is after this condition (I give further another alternative) */
{document.write('\<\lin'+'k\ rel=\"stylesheet\"\ type=\"text/css\" href=\"Netscape4xStyle.css\"\>'); }
//-->
</script>
<style type="text/css">
<!--
@import url(otherBrowsers.css);
-->
</style>

I got the basic hint from Sam Marshall, but I changed it concerning the browser detection. The system works in all browsers. Users of MS IE, Opera and new Netscape/ Mozilla Gecko browsers it doesn't matter anything, if the JavaScript-support has been turned off. The JavaScript is only needed for the Netscape 4. series and style sheets don't work at all in Netscape 4.x browsers, if JavaScript has been turned off. If all browsers get the style sheets with JavaScript, when the the JavaScript is turned off, CSS don't work at all. In some conditions a part of the CSS might be reasonable to give by using JavaScript-encoding. I handle these kinds of situations in the extra page, which handles dynamic menus[S].

The problem of the previous example is that media blocks[S] and that way media types can't be used, if the purpose is that pages works well also in Mac browsers. MS IE for Mac (concerns at least to the version 5.0) namely doesn't support media blocks (@media {...} but skip all CSS, which is inside them.

Opera has another special problem. It reads always the @import at-rule to all media types, if there is not told, which media type is used (this concerns at least until the version 5.11). The media type specifier (for example @import url(...) screen;) works in few browsers. @media and @import at-rules should not be used at all, if the purpose is to create CSS-code for all media type supporting browsers!

A better variation of the same basic idea is to generate for the Netscape 4.x series own CSS-files and comments around files, which Netscape 4.x should not read. The way of the following example makes possible the functionality of media types also in Mac browsers (the following code is for XHTML-documents):

<script language="JavaScript" type="text/javascript">
<!--
if (document.layers)
{document.writeln('\<lin'+'k\ rel=\"stylesheet\"\ type=\"text/css\"\ href=\"../Css/basicNetscape4.css\"\ \/\>');
document.writeln('\<lin'+'k\ rel=\"stylesheet\" type=\"text/css\"\ href=\"../Css/Netscape4SomeOtherSite.css\"\ \/\>');}

//-->
</script>
<script language="JavaScript" type="text/javascript">

<!--
if (document.layers)
{document.write('\<'+'!\-\-'); }
/* If the comment tags have not generated in two parts, browsers might handle them incorrectly! If instead of \-\- have been marked as -- validator services interprets the code so, that in the document has nested comments, which are not allowed. */
//-->
</script>
<link rel="stylesheet" type="text/css" href="../Css/CssSitePrint.css" media="print" />
<link rel="stylesheet" type="text/css" href="../Css/CssSiteProjection.css" media="projection" />
<link rel="stylesheet" type="text/css" href="../Css/CssSiteScreen.css" media="screen" />
<script language="JavaScript" type="text/javascript">

<!--
if (document.layers)
{document.write('--'+'\>'); }

//-->
</script>

I have found that the difference between first and last Netscape 4.x series is quite big concerning the reliability of browsers. Netscape 4.04 crashes very easily but Netscape 4.79 is quite stable. Presumably also Netscape 4.6x is quite stable. If necessary it is possible to make own CSS for different Netscape 4.x series browsers. In the example below Netscape 4.0x-4.5x and newer Netscape 4.x series browsers get different CSS:

<script language="JavaScript" type="text/javascript">
<!--
if (document.layers)
{document.writeln('\<lin'+'k\ rel=\"stylesheet\"\ type=\"text/css\"\ href=\"../Css/basicNetscape4.css\"\ \/\>');}

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
/* Because in this case is needed more exact browser detection, the process has two parts. The purpose is that first condition is that Opera would skip in all circumstances the script for Netscape 4.x */

if (navigator.userAgent.indexOf('Opera')!=-1){} /* Because Opera finds a detections string, which fits for it, it skips the next block even if pretends to be a Netscape 4.x browser. Works reliable at least starting from Opera 4.02+. Older Opera browser don't always give this string, when they can't be reliable detected at this way. In principle also document.getElementById could be used but according to an e-mail Netscape 4.x has sometimes difficulties with unsupported methods. */

else if (navigator.appName.indexOf("Netscape")!=-1 &&
navigator.appVersion.indexOf("4.7")>=0)
/* Without the first condition this block would concerns also Opera browsers, if they identify as Netscape 4.7x. */
{document.writeln('\<lin'+'k\ rel=\"stylesheet\" type=\"text/css\"\ href=\"../Css/Netscape4CssSite.css\"\ \/\>');}
//-->
</script>

Note. It is also possible to use JavaScript in order to identify other matters than the name and the version number of some browsers, for example the size or the color depth of the screen and the create screen dependent CSS-files. Instead only few browsers have the possibility to switch between default and alternative style sheets. You can search JavaScript examples by using in common search engines (like Altavista and Google) for example keywords javascript+window+color depth and javascript+window+size.

The alternative of JavaScript is to use serve side encoding, which it is not dependent, if JavaScript support is in use. But server-side encoding can't test, which features the JavaScript interpreters of different browsers support, when method-based detections can't work. At least Opera can easily get incorrect CSS. By using JavaScript it is also easier to take account situations, where the JavaScript-support has been turned off. I handle however PHP-based detections[S] in mixed information technology pages.

Webreference (the color depth), Javascripter (the size of the window), Sam Marshall (United Kingdom; The writer of the first hint).

Without linking

You can use these without linking:

I give you two examples, how to define CSS for Netscape 4.x browsers:

Especially problematic features

Trying to get good presentations, following matters are especially problematic:

Because you can't do anything to these, I recommend to define following properties so, that Netscape 4.x doesn't read them or it gets them only in some circumstances:

Some other hints

W3C: CSS1 Test Suite: 5.5.25 float[Pw].

A list of errors in the CSS1 Test Suite[S][Pw] in my Finnish page is terrible long and in fact I should be longer, but I was not sure of some pages and I don't put them into the list.

Remember. The CSS-implementation of Netscape 4.x is in many matters very bad. Certain in many matters about the same level as MS IE 3.02 (the most important difference is to support most features of CSSP (P = position), which is today part of CSS2). The basic structures documents should base on HTML 3.2. Netscape 4.x must be handled primary as HTML 3.2 capable browser, which can give a little bit CSS.

[Top]