Forum Moderators: not2easy

Message Too Old, No Replies

Why can't I link my stylesheets in Firefox

linking stylesheets firefox

         

ngc628

8:28 pm on Mar 24, 2009 (gmt 0)

10+ Year Member



My site works in Explorer 6.0 but not in Firefox 3.0.7...?!?

Here's my header

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title>Home - example.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet" href="machel.css" media="screen">
<link rel="stylesheet" href="menuv.css" media="screen">

<!--[if lt IE 7]>
<style type="text/css" media="screen">
body{behavior:url(csshover.htc);}
</style>
<![endif]-->

</head>

If the css is on the page it works in firefox.

My page validated okay.

[edited by: swa66 at 9:13 pm (utc) on Mar. 24, 2009]
[edit reason] removed specifics [/edit]

Demaestro

8:51 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try single tag closing these tags like this:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="machel.css" media="screen" />
<link rel="stylesheet" href="menuv.css" media="screen" />

bedlam

9:01 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Try single tag closing these tags like this:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="machel.css" media="screen" />
<link rel="stylesheet" href="menuv.css" media="screen" />

That's ridiculous. He's using an HTML 4.01 doctype. Only flavours of xml (such as xhtml) require self-closing tags. Besides that, forgetting to close a link or meta tag does not cause any problems like this that I've ever heard of.

ngc628, given the symptoms you describe it's difficult to figure out what might be wrong. I'd suggest that the paths in the link elements might be wrong if you hadn't said that the styles work in IE. It might be worth your adding the Web Developer Toolbar [addons.mozilla.org] to Firefox and using the CSS > View CSS option to see if any of your stylesheets are not being found. You can also figure out if your stylesheets are being found and applied using Firebug [addons.mozilla.org].

-- b

Demaestro

9:07 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sorry I thought a strict doc type required such a thing and I know that FF pays attention to such things whereas IE6 doesn't.

Guess I am wrong

swa66

9:10 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



xhtml needs the self closing tags, html doesn't.

- Is your server configured to serve the css as text/css ?

Are you sure the page reacts to nothing in the linked CSS ?

Remember that when it reacts differently that in 99.9% of the cases it's the legacy IE versions that are wrong, not Firefox. One of the main reasonsto never develop a site in IE.

Demaestro

9:18 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks swa. Somehow got that mixed up in my head.

ngc628

10:15 pm on Mar 24, 2009 (gmt 0)

10+ Year Member



Thank you for your replies.

I don't have the site uploaded yet I am using working locally.

The css files are in the same folder as my html file.