Welcome to WebmasterWorld Guest from 54.159.44.227

Forum Moderators: not2easy

Message Too Old, No Replies

NN4 Not Picking up StyleSheet?

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

     

vmaster

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

10+ Year Member



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 ...?

pageoneresults

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

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



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

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

madcat

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

WebmasterWorld Senior Member 10+ Year Member



I might have misunderstood the situation, but

[webmasterworld.com...]

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

Nick_W

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

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



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

madcat

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

WebmasterWorld Senior Member 10+ Year Member



Maybe I did get you wrong, I write mine like vmaster's example...

Nick_W

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

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



[w3.org...]

- Still, yours works madcat right?

Nick

jimbeetle

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

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



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

pageoneresults

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

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



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.

madcat

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

WebmasterWorld Senior Member 10+ Year Member



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.

SuzyUK

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

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



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

pageoneresults

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

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



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.

pageoneresults

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

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



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

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

Nick_W

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

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



Problem solved, nice work P1R!

Looks like it changed in CSS2...

Nick

vmaster

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

10+ Year Member



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 ...?

Nick_W

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

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



>NS 4.7

NS4 wont pick up ANY @imports...

Nick

vmaster

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

10+ Year Member



Then what is the workaround please, considering I wish to use the same stylesheet for all browsers?

Tamarick

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

10+ Year Member



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.

Tamarick

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

10+ Year Member



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" />

papabaer

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

WebmasterWorld Senior Member 10+ Year Member



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!

Nick_W

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

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




<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

vmaster

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

10+ Year Member



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?

Nick_W

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

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



Msg18

Nick

vmaster

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

10+ Year Member



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 ...

Nick_W

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

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



NN4 can do this:

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

Nick

pageoneresults

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

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



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!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month