Forum Moderators: not2easy

Message Too Old, No Replies

Firefox compatability issue

firefox css

         

delmonte21

11:12 pm on Nov 30, 2008 (gmt 0)

10+ Year Member



Hi all,

My CSS works fine with Windows Internet Explorer, and passes w3c validation, but Firefox simply does not register the .css file and loads my page as if the CSS does not exist. Incidentally, when the code is imbedded in the xhtml through <style> tags in the header, it works fine - and I have triple checked that the <link> tags link to the correct CSS file.

So I've saved the following in the .css file:


body{font: 70% sans-serif}
div#image{float:right}
div#introduction{margin-top:28px}
div#maininformation{clear:both;margin-left:150px;margin-right:150px}

Anybody have any idea? I've been wrestling with this for some time.

Thanks,

delmonte

alt131

11:27 pm on Nov 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi delmonte21,
Firefox simply does not register the .css file and loads my page as if the CSS does not exist.
Quick thought is to confirm style sheets haven't been disabled. In Firefox:
View > Page Style > No Style (Should be "Basic Page Style")

piskie

1:03 am on Dec 1, 2008 (gmt 0)

10+ Year Member



IE is very "Error Forgiving" whereas FF tends to be less so. Check your Link to the external css to make sure ir is formed correctly.

swa66

2:00 pm on Dec 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you serving your css as "text/css" ?

Check it be trying to view the full URL where the CSS is served from
e.g. http://www.example.com/some/directory/stye.css
And next check the tools/page info (command-I on a mac, unsure what if any keyboard shortcut exists for it on windows). The second line of the general tab should read "type: text/css"

if this isn't the case, check your server settings (e.g. mime.types in apache).

Still if your mime.types are in order, try thee two files:
index.html:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>untitled</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<p>Not working or </p>
</body>
</html>

test.css


p:after {
content: ' working';
color: green;
}
p {
color:red;
}

put them in the same directory and check the result.

If that still doesn't work I'd suspect something server or client side amiss (try another client first, that's likely to be the easiest (safari, opera, ...) )

Validating is important, but in the end it's not because it validates that you are telling the browser something that matches what you intended to say.
Moreover IE does parse and act on stuff that for all other purposes are comments (conditional comments)

[rant on]

IE is very "Error Forgiving"
IMHO this should be "IE is very Error Inducing" e.g. its overzealous use of quirksmode, its broken box model, all the named bugs that never got fixed.
It's not like MSFT doesn't know it's broken; it's just that they seem to be unwilling or unable to repair it. Since they've updated it almost on a monthly basis with security patches, and even slipped in the very unwelcome "eloas" patch to work around them being unwilling to pay for their use of a patent, I can only conclude it's the unable to fix and hence I tend to think of IE as "broken beyond repair".
[rant off]