4 replies [Last post]
xombii
Offline
newbie
Puyallup, WA
Last seen: 10 years 12 weeks ago
Puyallup, WA
Timezone: GMT-6
Joined: 2003-11-20
Posts: 9
Points: 0

This is a problem left over from an earlier issue. The Netscape browsers (7.1, Mozilla and Firefox) aren't changing my page after I change and resave my CSS document.

My humble CSS:

<STYLE TYPE="text/css">
<!--

.column {
background-image: url(images/bg_column.jpg);
background-repeat: repeat-y;
background-color: #ffffff;
color: #333333;
font: 75% Arial, Helvetica, sans-serif;
text-align: justify;
padding-left: 20px;
padding-right: 20px;
width: 170px;
}

-->
</STYLE>

And my HTML page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Column Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="column_test.css" rel="stylesheet" type="text/css">
</head>

<body>

<img src="images/column_top.jpg" alt="top" /><div class="column">Content for this column goes here.</div><img src="images/column_bot.jpg" alt="bottom" />

</body>
</html>

I can make any change I want to my style sheet but none of the Netscape browsers pick it up. Where's the typo? Where's the doc type error? Show me what I did wrong, someone... PLEASE! It's as if Netscape won't even acknowlege I have a style sheet attached!

X~

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 49 weeks 4 days ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Netscape browsers ignoring style sheet?

Hi

If the css you have shown is what is in your extarnal stylesheet, I'm not surprised. It shouldn't have these bits in:

<STYLE TYPE="text/css"> 
<!--

and

--> 
</STYLE>

Trevor

xombii
Offline
newbie
Puyallup, WA
Last seen: 10 years 12 weeks ago
Puyallup, WA
Timezone: GMT-6
Joined: 2003-11-20
Posts: 9
Points: 0

Wha...?

Where the hell did I get those then? I recall seeing that at the beginning and end of a style sheet for some reason... is that only used in internal style sheets?

I was told to add the <!-- and --> to hide css from older browser I believe... is that wrong too?

Oh, and thanks Trevor. Guru is a fitting title.

X~

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 49 weeks 4 days ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Re: Wha...?

xombii wrote:
Where the *beep* did I get those then? I recall seeing that at the beginning and end of a style sheet for some reason... is that only used in internal style sheets?

Yes, only in internal style sheets. IE ignores them if in extarnal ones, but sometimes it causes top and bottom padding in IE. Mozilla ignores the stylesheet

Quote:
I was told to add the <!-- and --> to hide css from older browser I believe... is that wrong too?

The best way to hide style from an older browser is not to link it, like this:

<link rel="stylesheet" href="css/basic.css" type="text/css"> But to do it like this:

<style type="text/css" media="screen">@import url("css/noodle_real.css");</style> Don't forget the quotes!

BUT, this causes a bug in IE (known as FOUC, or flash of unstyled content) where IE doesn't read the style until the document has loaded, so you need any piece of java in the head or a proper link to stylesheet just to stop this from happening (don't know why it works, but it does. My preference is to have a really basic stylesheet for the older browsers, and then the real one for the modern ones.

Quote:
Oh, and thanks Trevor. Guru is a fitting title.

That was Tony's idea, not mine Laughing out loud

Trevor

firstreflex
firstreflex's picture
Offline
Enthusiast
Brooklyn USA
Last seen: 12 years 32 weeks ago
Brooklyn USA
Timezone: GMT-5
Joined: 2003-10-21
Posts: 104
Points: 0

Netscape browsers ignoring style sheet?

The browsers that you used to have to hide all styles from are long gone. There is no need anymore to use comments in the head to hide styles or javascript.