/    Sign up×
Community /Pin to ProfileBookmark

@import method not working NN4.7

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

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

thanks in advance:o

to post a comment
Full-stack Developer

9 Comments(s)

Copy linkTweet thisAlerts:
@DaveSWSep 15.2003 — 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
Copy linkTweet thisAlerts:
@bobmurphyauthorSep 15.2003 — 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 ??
Copy linkTweet thisAlerts:
@DaveSWSep 16.2003 — 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?
Copy linkTweet thisAlerts:
@FangSep 16.2003 — A bit of [URL=http://www.alistapart.com/stories/n4switch/]style sheet swapping[/URL] could work
Copy linkTweet thisAlerts:
@bobmurphyauthorSep 16.2003 — no it seems to read the style sheet but it doesnt understand the negative margains so the page is centred wrong
Copy linkTweet thisAlerts:
@DaveSWSep 16.2003 — 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.
Copy linkTweet thisAlerts:
@DaveSWSep 16.2003 — 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!
Copy linkTweet thisAlerts:
@Robert_WellockSep 16.2003 — The @import must be the first item on an external CSS file.
Copy linkTweet thisAlerts:
@bobmurphyauthorSep 16.2003 — 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:
×

Success!

Help @bobmurphy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...