Welcome to WebmasterWorld Guest from 23.22.220.37

Forum Moderators: not2easy

Message Too Old, No Replies

NN4 Not Picking up StyleSheet?

Is the css statement format correct, or is there an alternative

     
5:01 pm on Apr 29, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


We have a site using an external stylesheet for formatting text and positioning of elements. We use the following statement in the head section to refer to the same.

<style type="text/css" media="all">@import "layout1.css";</style>

The html document as well as the stylesheet validate perfectly.

When I view the site in IE, it is fine, but when it is viewed in NS 4.7, it simply doesn't pick up the stylesheet. Since I know NS4.7 supports css, there is definitely something in the above statement that's not right. Any ideas ...?

5:04 pm on Apr 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12166
votes: 51


Hello vmaster, I believe it is formatted incorrectly, ours looks like this...

<style type="text/css">@import url(/css/file.css);</style>

5:05 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 15, 2002
posts:971
votes: 0


I might have misunderstood the situation, but

[webmasterworld.com...]

[edited by: madcat at 5:11 pm (utc) on April 29, 2003]

5:08 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Yes, P1R is correct. Mine look like his too ;)

I've seen alot of people write them like yours too though so maybe there's some dodgy info out there or somthing?

Nick

5:13 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 15, 2002
posts:971
votes: 0


Maybe I did get you wrong, I write mine like vmaster's example...
5:25 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


[w3.org...]

- Still, yours works madcat right?

Nick

5:26 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 26, 2002
posts:3292
votes: 6


Hope I'm not reading this thread wrong, but as topr8 says in madcat's above link, NN4 doesn't support @import, you have to use "link."

Jim

5:28 pm on Apr 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12166
votes: 51


Something I should point out, Netscape is reading the normal style reference...

<link href="/css/file-nn.css" type="text/css" rel="stylesheet">

The rest of the browsers ignore the main style call and get the @import style sheet.

5:32 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 15, 2002
posts:971
votes: 0


Something I should point out, Netscape is reading the normal style reference...

Exactly ^

I was just saying that I write my @import's like vmaster's example in browsers that support @import.

5:40 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
posts:5199
votes: 0


Pageoneresults
The rest of the browsers ignore the main style call and get the @import style sheet.

I don't think the rest ignore the first call, its just that because of the cascade the styles in the second one will take preference...something to be aware of perhaps to make sure any unwanted styles in the first sheet are explicitly overruled in the second sheet (e.g. if you're designing a simple site for NN4 with the first sheet..)

BTW I write mine like vmaster too and it works fine...

Suzy

5:41 pm on Apr 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12166
votes: 51


Hmmm, so which format is correct.

Typically what I do is build my main style sheet, and then do a save as. From there I strip out all of the attributes that I know cause NN problems and use that as my NN style sheet.

5:46 pm on Apr 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12166
votes: 51


Ah-ha, they are both correct formats...

W3C - 6.3 The @import rule [w3.org]

5:59 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Problem solved, nice work P1R!

Looks like it changed in CSS2...

Nick

6:04 pm on Apr 29, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


But the format I'm using doesn't work for Netscape - when it is viewed in NS 4.7, it simply doesn't pick up the stylesheet. So any conclusive solution to the problem? Simply use the other format, I presume ...?
6:07 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


>NS 4.7

NS4 wont pick up ANY @imports...

Nick

7:00 pm on Apr 29, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


Then what is the workaround please, considering I wish to use the same stylesheet for all browsers?
7:08 pm on Apr 29, 2003 (gmt 0)

New User

10+ Year Member

joined:Apr 20, 2003
posts:16
votes: 0


The @import statement was designed for Standard Compliant Browsers so a web designer could utilize the benefits of css2 and either not display a stylesheet for "non standard compliant browsers" or slip them a different stylesheet.

This will not work for NS 4.7 and below... and anything below I.E 5.0...

And for the record.. NS 4.7 supports css1 not css2... It definitely dosen't fully support css positioning.

7:10 pm on Apr 29, 2003 (gmt 0)

New User

10+ Year Member

joined:Apr 20, 2003
posts:16
votes: 0


The work around is to either use two different stylesheets, or just use a standard <link rel="stylesheet" type="text/css" media="all" href="stylesheet.css" />
8:09 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 31, 2001
posts:1238
votes: 0


I used to protect NN4.x from style sheets by using the @import rule, but I never really liked that as a preferred method. Especially since I want to offer alternative style sheets.

I now use this construct:

<link rel="stylesheet" href="some.css" type="text/css" media="all" />

as NN.4 does not comprehend the media="all" statement.... which, is what you also include in your example.

Thank goodness NN4.x is just about dead and buried.

The University of Illinois, Urbana/Champaign, recently purchased 40,000 user licenses for the Opera browser----and replaced NN.4 as their default browser. Another prominent German university also recently made the change. As more educational institutions migrate to Standards compliant browser, the Web Development community as a whole will benefit greatly. --Here's to the future!

8:13 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0



<link rel="stylesheet" href="some.css" type="text/css" media="all" />

Why do I have this nagging feeling that there is some problem with that?

It's a fantastic solution of course but I just have this idea that I looked at doing that once and dismissed it 'cos it caused some other oddities I wasn't happy with...

Am I talking rubbish or can anyone get what I'm at here?

Nick

8:30 pm on Apr 29, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


Well, papabaer if NN4.x cannot digest media="all", and Nick you've got a funny feeling about that too, then what is the best, or at least acceptable, way to feed NN4.x with stylesheet information?
8:32 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Msg18

Nick

8:48 pm on Apr 29, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


But as per papabaer, NN.4 does not comprehend the media="all" statement - is that true? Wouldn't that defeat the very purpose we're trying to achieve here, of making NN4.x get the stylesheet ...
8:50 pm on Apr 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


NN4 can do this:

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

Nick

8:53 pm on Apr 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12166
votes: 51


This is what I've been doing...

<link href="/css/style-nn.css" type="text/css" rel="stylesheet">
<style type="text/css">@import url(/css/style.css);</style>

I haven't experimented with any other methods yet. I picked up the @import command from tedster and I believe papabaer back in the days!