Click to See Complete Forum and Search --> : @import method not working NN4.7


bobmurphy
09-14-2003, 05:15 PM
someone suggested that i use the @import method to hide a stylesheet from NN4.7 but it doesnt seem to work - can anyone spot my error - thanks

http://www.oneweekofdays.com/testerfolder/master/index.html
ps i also need to hide the page from opera 5.02 -- any ideas ???

thanks in advance:o

DaveSW
09-15-2003, 12:00 PM
I think the location under your @import should be

<style type="text/css" media="all"><!--
@import "masterStyleSheet.css";
--></style>


Additionally, I would normally just place this line

@import "masterStyleSheet.css";

at the top of the styleSheet.css document.

Hope this helps. You may also wish to remove the caps in your filenames.

Dave

bobmurphy
09-15-2003, 05:42 PM
tried that dave - still no luck - i think i might try using php to dodge the css file for this browser -- btw what is the story with capatalising file names is there something wrong with it ??

DaveSW
09-16-2003, 01:51 AM
File capitals was just an idea - some older browsers are fussy about that.

What exactly do you mean when you say it doesn't work? Does Netscape 4 actually read the stylesheet?

Fang
09-16-2003, 02:41 AM
A bit of style sheet swapping (http://www.alistapart.com/stories/n4switch/) could work

bobmurphy
09-16-2003, 08:48 AM
no it seems to read the style sheet but it doesnt understand the negative margains so the page is centred wrong

DaveSW
09-16-2003, 09:52 AM
Netscape doesn't understand position:absolute;

you need to move all of the code relating to position:absolute into your stylesheet hidden by the @import rule, removing it from your normal stylesheet.

DaveSW
09-16-2003, 09:56 AM
you also need to remove all html tags from your stylesheets.


In CSS:
/* This is a comment */

NOT
<!--This is a comment-->
BECAUSE THAT'S A HTML COMMENT!

Sorry for shouting LOL.

Also, no <style> tags - in short NO HTML in your style sheet.



http://www.w3schools.com/css/default.asp is a good tutorial if you wish to brush up on your css. I did notice you've got the correct syntax in your second stylesheet!

Robert Wellock
09-16-2003, 11:41 AM
The @import must be the first item on an external CSS file.

bobmurphy
09-16-2003, 12:30 PM
right -- got it -- thanks for your help --- it was actually a stupid mistake -- there was a second sheet on the page which i thought was blank but i must have mixed up the names or something so there was info on there - it was this stuff that was doing the damage -- apologies for involving you in a wild goose chase -- thanks for your help:rolleyes: