homepage Welcome to WebmasterWorld Guest from 54.198.224.121
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
CSS and Netscape 4
workarounds when you MUST support
tedster




msg:1194382
 10:44 pm on Apr 28, 2002 (gmt 0)

I am working on a new site - it will replace the client's older site which gets around 35% Netscape 4 traffic, so ignoring that antique browser is not an option, but I still want to write the best code I can. Here are some tools I've discovered.

1. I can workaround float:right by creating a one cell <table align="right">. Yes, the align attribute is deprecated, and this method is using tables for display. But it WORKS. A relatively simple trade-off in some situations.

2. Netscape 4 is notorious for "forgetting" styles in the HTML that follows after a table. This can often be fixed by wrapping the table in it's own set of <div></div> tags. Somehow, this "unnecessary" addition reminds the browser of what it is supposed to be doing.

3. Unforunately, when I try to combine 1 and 2 above, the entire table vanishes from the screen in NN4. Oh, well.

 

Eric_Jarvis




msg:1194383
 10:22 am on Apr 29, 2002 (gmt 0)

I keep building so that sites will work in Netscape 4...but I long ago stopped trying to make them look anything like the site will look in other browsers

just use the @import hack and relax in the assumption that Netscape 4 users aren't after the most stunning possible look

mikegram




msg:1194384
 3:56 pm on Apr 29, 2002 (gmt 0)

@import hack???

Eric_Jarvis




msg:1194385
 4:27 pm on Apr 29, 2002 (gmt 0)

link to the style sheets using both:

<link rel="stylesheet" type="text/css" href="style/nnstyle.css">
<style type="text/css" media="all">@import "style/style.css";</style>

older browsers will pick up the link rel but not the @import...newer browsers will override with the latter style sheet

not the way thing are intended to be, but it does no actual harm

pageoneresults




msg:1194386
 4:34 pm on Apr 29, 2002 (gmt 0)

> 2. Netscape 4 is notorious for "forgetting" styles in the HTML that follows after a table. This can often be fixed by wrapping the table in it's own set of <div></div> tags. Somehow, this "unnecessary" addition reminds the browser of what it is supposed to be doing.

Hello tedster, I too was faced with that issue back in the beginning of my CSS journey. What I found was that the area after the table did not have a block element containing it. So, I wrapped that following paragraph in a <p> tag since it was not there to begin with and it should have been. That did the trick.

pageoneresults




msg:1194387
 4:42 pm on Apr 29, 2002 (gmt 0)

I should also point out that NN4.x is very unforgiving when it comes to improperly nested tags. If there is one thing out of order, or a closing tag missing, it chokes and renders your CSS improperly.

Here are some of the problems I found and fixed while making my sites cross browser friendly.

1. <form> tags work better when they are enclosed in a block element like a <p> tag. If you don't have a block element surrounding the <form> tag, NN4.x does not render any CSS after it!

2. I work in FP. Every now and then FP has a bad habit of inserting <span> tags when I make a change to something. Its not real frequent, but when that <span> is there, NN4.x chokes on the CSS and does not render anything after the <span> correctly.

3. NN4.x does not like <p align> tags. I've found that if you are using tables, you should specify the alignment in the cell and not the paragraph. The <p align> works but not in all instances, depends on where it is and what surrounds it.

4. NN4.x does not like <h> tags without a font-family assigned to them. You won't catch this unless you have your default font for browsing set to Times. I have mine set at Arial because I hate times and every now and then I'll catch a block level element that needs to have a font-family assigned. You would think that assigning the font family to the <body> would do it, but it does not. I believe the same issue applies to <li>, <ol> and <ul>.

Those are just some of the easy ones that I've encountered. I'm fortunate that the CSS I've been working with is compatible in all browsers, I made sure of that. No float:right or float:left, I've been sticking with non-fluid layouts. Once NN4.x falls off the face of this earth, then I'll play with those properties and values. Until then, I'm limited in what I can do design wise.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved