/    Sign up×
Community /Pin to ProfileBookmark

Need to hack Netscape 4. to ignore CSS

hi,
I’m using CSS to create fluid layout for my pages. It works on every browser except Netscape 4+. Unfortunately, everyone at work still uses Netscape 4.7. Do you know any niffty Javascript I could use to have Netscape ignore the code?

thank ya!
sofiushka

here’s the code i’m using:
<style type=”text/css” media=”screen”>
body {
margin:20px 0px; padding:0px; /* Need to set body margin and padding to get consistency between browsers. */
text-align:center; /* Hack for IE5/Win */
}

div.left {
position: absolute;
top: 0px;
left: 10px;
width: 200px;
height: 432px;
}

div.top {
position: absolute;
top: 0px;
left: 200px;
width: 580px;
height: 150px;
}

div.main {
position: absolute;
top: 150px;
left: 200px;
width: 580px;
height: 282px;
}
div.container {
position: relative;
margin: 0 auto;
width: 780px;
height: 432px;
text-align: left;
}

</style>


__________________

sofiushka

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrMay 28.2004 — No JS is required at all; just import the CSS via the @import rule.

Put the CSS in an external stylesheet, then import it into your document like this:
<i>
</i>&lt;style type="text/css"&gt;
@import "css/style_sheet.css";
&lt;/style&gt;

You can look at this [url=http://centricle.com/ref/css/filters/]hack chart[/url] to see how you can filter out different browsers by writing it differently.
Copy linkTweet thisAlerts:
@sofiushkaauthorMay 28.2004 — ah! brilliant. because Netscape 4+ does not recognize external CSS. right. thanks a bunch!!
Copy linkTweet thisAlerts:
@Paul_JrMay 28.2004 — [i]Originally posted by sofiushka [/i]

[B] because Netscape 4+ does not recognize external CSS.[/B][/QUOTE]

The @import rule was introduced in CSS 2 (I'm pretty sure...), and NS 4.x barely gets CSS 1; so that makes it a handy way to keep old browsers from seeing your CSS and screwing up the page. ?

[i]Originally posted by sofiushka [/i]

[B]thanks a bunch!![/B][/QUOTE]

No problem. ?
×

Success!

Help @sofiushka 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.20,
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,
)...