homepage Welcome to WebmasterWorld Guest from 54.198.94.76
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

CSS Forum

    
NN4 Not Picking up StyleSheet?
Is the css statement format correct, or is there an alternative
vmaster




msg:1199767
 5:01 pm on Apr 29, 2003 (gmt 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 ...?

 

pageoneresults




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

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

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

madcat




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

I might have misunderstood the situation, but

[webmasterworld.com...]

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

Nick_W




msg:1199770
 5:08 pm on Apr 29, 2003 (gmt 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

madcat




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

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

Nick_W




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

[w3.org...]

- Still, yours works madcat right?

Nick

jimbeetle




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

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




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

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




msg:1199775
 5:32 pm on Apr 29, 2003 (gmt 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.

SuzyUK




msg:1199776
 5:40 pm on Apr 29, 2003 (gmt 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

pageoneresults




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

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




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

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

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

Nick_W




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

Problem solved, nice work P1R!

Looks like it changed in CSS2...

Nick

vmaster




msg:1199780
 6:04 pm on Apr 29, 2003 (gmt 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 ...?

Nick_W




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

>NS 4.7

NS4 wont pick up ANY @imports...

Nick

vmaster




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

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

Tamarick




msg:1199783
 7:08 pm on Apr 29, 2003 (gmt 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.

Tamarick




msg:1199784
 7:10 pm on Apr 29, 2003 (gmt 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" />

papabaer




msg:1199785
 8:09 pm on Apr 29, 2003 (gmt 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!

Nick_W




msg:1199786
 8:13 pm on Apr 29, 2003 (gmt 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

vmaster




msg:1199787
 8:30 pm on Apr 29, 2003 (gmt 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?

Nick_W




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

Msg18

Nick

vmaster




msg:1199789
 8:48 pm on Apr 29, 2003 (gmt 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 ...

Nick_W




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

NN4 can do this:

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

Nick

pageoneresults




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

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!

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved