Deanjoe Deanjoe - 1 month ago 9
CSS Question

Why Firefox won't start Css without errors message?

I write this sample code on notepad for an html site with css but this won't work on Mozilla(version49.0.etc) while it does on IE, Chrome and Opera. If i start it on FF, debugger says "CSS has no errors" but it only display html code.
Someone know how to fix it?

Here there are the codes(html and CSS) of my site on local path:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
http://www.w3.org/TR/html4/loose.dtd>
<html lang="it">
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="iso-8859-1">

<title>Site</title>

<style type="text/css">
</style>
<link href="C:/Users/Dean/Desktop/Site/File/file1.css" rel="stylesheet" media="all">


</head>



<body class="sub">
<div class="alt">


<h1>Text here</h1>

</div>
</body>
</html>


And here there is the CSS file properties:

.sub{background-image:url("../image/bg.jpg");
background-repeat:no-repeat;
background-size:100% 100%;
background-attachment:fixed;

}


.alt {background-color:hotpink;
box-align:right;
border-radius:10px;
}

.set {font-size:12px;
color:white;
}

Answer

I'm assuming it is because your stylesheet is linked via the non standard file protocol (href="C:/Users/Dean/Desktop/Site/File/file1.css"). From my experience, Firefox usually complies to standards more than other browsers.

I'm assuming this is why your example works in other browsers, but not in FF. Try serving your stylesheet using an HTTP server.

Comments