Style sheets & Mozilla

V

Vince Morgan

Hi All,
I'm having a bit of a problem with a style sheet.
I thought it could perhaps be a path problem, but I've eliminated that one
by dropping it into the document root and the behaviour remained the same.
The link is between the '<head></head>' tags and works in IE, but not
Mozilla.
So I tried '<style>@import url(..Styles/sheet.css); </style>' wich also
works fine in IE, but didn't in Mozilla.
As the page is generated via php I eventualy loaded the sheet into a var and
embedded it, which works fine in either browser.
Although I've found a workable solution I'm still very curious and would
like very much to know why the standard methods are not working for me in
Moz.
Any info or help with this is more than welcome,
TIA
Vince Morgan
 
D

dorayme

"Vince Morgan said:
Hi All,
I'm having a bit of a problem with a style sheet.
I thought it could perhaps be a path problem, but I've eliminated that one
by dropping it into the document root and the behaviour remained the same.
The link is between the '<head></head>' tags and works in IE, but not
Mozilla.
So I tried '<style>@import url(..Styles/sheet.css); </style>' wich also
works fine in IE, but didn't in Mozilla.
As the page is generated via php I eventualy loaded the sheet into a var and
embedded it, which works fine in either browser.
Although I've found a workable solution I'm still very curious and would
like very much to know why the standard methods are not working for me in
Moz.
Any info or help with this is more than welcome,
TIA
Vince Morgan

Show us the url with it in the head, and what platform, OS ,
which particular version of browser?
 
V

Vince Morgan

dorayme said:
Show us the url with it in the head, and what platform, OS ,
which particular version of browser?

Hi Dorayme,
The IE vers is 6.0.2800.1106;
Mozilla ActiveX Control v1.7.12;
OS win2000.
The IDE is Dev-PHP 2.0.12.
I'm working in an IDE (local server) as I don't have a server on this
(win2000) machine.
However, below I have included code that replicates the problem when using
<link>.
The directory struct is,

Root
|-\Styles
|-\HTML

In the 'HTML' dir;
<snip>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.2)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.2)">
<link rel=StyleSheet href="../Styles/reqHeader.css" type="text/css">

<script type="text/javascript">
var theForm = null;
</script>

</head>
<body>
<div class="Head">This is a test.<div>
</body>
</html>

</snip>

In the 'Styles' dir;
<snip>

..Head
{
color:#306090;
font-family:Helvitica, Arial;
font-weight:Bold;
font-size:16px;
}

</snip>

Perhaps the Mozilla control doesn't work exactly the same as the stand-alone
browser? Thinking aloud textualy :)

Vince
 
D

dorayme

"Vince Morgan said:
Hi Dorayme,
The IE vers is 6.0.2800.1106;
Mozilla ActiveX Control v1.7.12;
OS win2000.
The IDE is Dev-PHP 2.0.12.
I'm working in an IDE (local server) as I don't have a server on this
(win2000) machine.
However, below I have included code that replicates the problem when using
<link>.
The directory struct is,

Root
|-\Styles
|-\HTML

In the 'HTML' dir;
<snip>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.2)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.2)">
<link rel=StyleSheet href="../Styles/reqHeader.css" type="text/css">

<script type="text/javascript">
var theForm = null;
</script>

</head>
<body>
<div class="Head">This is a test.<div>
</body>
</html>

</snip>

In the 'Styles' dir;
<snip>

.Head
{
color:#306090;
font-family:Helvitica, Arial;
font-weight:Bold;
font-size:16px;
}

</snip>

Perhaps the Mozilla control doesn't work exactly the same as the stand-alone
browser? Thinking aloud textualy :)

Vince

First thing I notice is no "" around the word Stylesheet in the
link to the sheet. But this is perhaps no problem. Next I notice
a failure to close the div after the test sentence. I reckon this
is a bit more important. Anyway, on the Mac version of Mozilla
(1.7.12) it does not stop it from appearing ok and being
controlled by the css when the file directory is as follows: the
css is in a folder (called Styles) within another folder. In this
last folder is another folder which contains the html file.

OK, lets take this again. I made a folder called "top", inside I
had 2 folders, one called "Styles" and one called "html". Inside
Stles was reqHeader.css while inside html was test666.html. This
had to be like this otherwise, no go. So are you getting your
paths right?
 
V

Vince Morgan

dorayme said:
First thing I notice is no "" around the word Stylesheet in the
link to the sheet. But this is perhaps no problem. Next I notice
a failure to close the div after the test sentence. I reckon this
is a bit more important. Anyway, on the Mac version of Mozilla
(1.7.12) it does not stop it from appearing ok and being
controlled by the css when the file directory is as follows: the
css is in a folder (called Styles) within another folder. In this
last folder is another folder which contains the html file.

OK, lets take this again. I made a folder called "top", inside I
had 2 folders, one called "Styles" and one called "html". Inside
Stles was reqHeader.css while inside html was test666.html. This
had to be like this otherwise, no go. So are you getting your
paths right?
Yes, sorry, my bad Dorayme. Such a small piece of code too.
Neither of those errors actualy made any difference to the problem though.
It seems from the above that your directory structure, the one that works,
is exactly as mine is here.
It still won't work within the IDE I'm using, but it's quite possible that
it will on my employers server.
I guess I'll find out tomorrow, all going well. The workaround is suitable
so I won't frett too much about it.
Thank you very much for taking the time to check it for me Dorayme.
Regards,
Vince
 
D

dorayme

"Vince Morgan said:
Yes, sorry, my bad Dorayme. Such a small piece of code too.
Neither of those errors actualy made any difference to the problem though.
It seems from the above that your directory structure, the one that works,
is exactly as mine is here.
It still won't work within the IDE I'm using, but it's quite possible that
it will on my employers server.
I guess I'll find out tomorrow, all going well. The workaround is suitable
so I won't frett too much about it.
Thank you very much for taking the time to check it for me Dorayme.
Regards,
Vince

The only other thing is ... perhaps it has been mentioned... some
servers are case sensitive, some not. Check carefully to have the
exact names re case in the links...
 
M

Michael Winter

Vince said:
I'm having a bit of a problem with a style sheet. ... The link is
between the '<head></head>' tags and works in IE, but not Mozilla.
[snip]

As the page is generated via php I eventualy loaded the sheet into a
var and embedded it, which works fine in either browser.

When PHP was generating the style sheet, did you set the Content-Type
header appropriately? Mozilla will, quite reasonably, refuse to use a
style sheet that isn't labelled with the text/css MIME type. This would
have been reported in the error console.

[snip]

If you still have problems, post a /link/ to a simple demonstration.

Mike
 
J

Jim Moe

Vince said:
So I tried '<style>@import url(..Styles/sheet.css); </style>' wich also
works fine in IE, but didn't in Mozilla.
I suppose you meant "../Styles/sheet.css".
Mozilla respects the concept of DocumentRoot. If <Styles> is located
above the DocumentRoot, Mozilla cannot get to it. IE ignores such pesky
standards limitations.
 
M

Michael Winter

Jim Moe wrote:

[snip]
Mozilla respects the concept of DocumentRoot. If <Styles> is located
above the DocumentRoot, Mozilla cannot get to it. IE ignores such pesky
standards limitations.

What? That makes absolutely no sense.

Mike
 
J

Jim Moe

Michael said:
What? That makes absolutely no sense.
Yeah, good point. There server should prevent any such inappropriate
behavior. I am not sure what issue I was thinking about when I wrote that,
but the above is drivel.
 
V

Vince Morgan

Vince Morgan said:
Hi All,
I'm having a bit of a problem with a style sheet.
I thought it could perhaps be a path problem, but I've eliminated that one
by dropping it into the document root and the behaviour remained the same.
The link is between the '<head></head>' tags and works in IE, but not
Mozilla.
So I tried '<style>@import url(..Styles/sheet.css); </style>' wich also
works fine in IE, but didn't in Mozilla.
As the page is generated via php I eventualy loaded the sheet into a var and
embedded it, which works fine in either browser.
Although I've found a workable solution I'm still very curious and would
like very much to know why the standard methods are not working for me in
Moz.
Any info or help with this is more than welcome,
TIA
Vince Morgan

Well, the links worked fine on the companies server, and today they also
work fine in the IDE.
I would love to report why they weren't working, if only I knew.
Occasionaly I get a glitch in the IDE, which is otherwise very good, and I
guess this was one of them.
Thanks Dorayme for trying to reproduce them, and to everyone who offered
their thoughts.
Regards,
Vince Morgan
 
T

Toby Inkster

dorayme said:
The only other thing is ... perhaps it has been mentioned... some
servers are case sensitive, some not. Check carefully to have the
exact names re case in the links...

If it was a problem with case, it wouldn't be specific to a single browser.
 
V

Vince Morgan

Vince Morgan said:
Hi All,
I'm having a bit of a problem with a style sheet.
I thought it could perhaps be a path problem, but I've eliminated that one
by dropping it into the document root and the behaviour remained the same.
The link is between the '<head></head>' tags and works in IE, but not
Mozilla.
So I tried '<style>@import url(..Styles/sheet.css); </style>' wich also
works fine in IE, but didn't in Mozilla.
As the page is generated via php I eventualy loaded the sheet into a var and
embedded it, which works fine in either browser.
Although I've found a workable solution I'm still very curious and would
like very much to know why the standard methods are not working for me in
Moz.
Any info or help with this is more than welcome,
TIA
Vince Morgan
Well, for what it's worth, I found the reason for this. I discovered that
it only happens after I add a <!DOCTYPE...> . Mozilla then requires that
the MIME type for the css be "text/css", and will not load if the MIME type
is presented as "text/plain", which is what my localhost server is
apparently serving up.
Regards,
Vince Morgan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top