css file not loading
For some reason this html page will not load the css file AND displays as gibberish in ff3.6.6 on mac, fine in Safari. http://www.mainstayprojects.com/teardrop.html
The same code works fine on another page: www.mainstayprojects.com/
The path to the css fi开发者_开发知识库le is correct and all the html and css validates. I'm at a loss as to what to try next!?
Help!
The HTML document is encoded as UTF-16 but the server claims it is ISO-8859-1, meanwhile the CSS appears to be ISO-8859-1 also, but the server has nothing to say about the encoding it is using.
To resolve this:
- Pick an encoding (UTF-8 is a good choice but see http://www.joelonsoftware.com/articles/Unicode.html )
- Configure your editor to save in it ( http://www.w3.org/International/questions/qa-setting-encoding-in-applications )
- Configure your server to mention it in the content-type header ( http://www.w3.org/International/O-HTTP-charset )
Basically, you have a character encoding mismatch, which is causing a no parse mode declaration error.
Specifically the browser is seeing a funny character before the DOCTYPE, since the browser is assuming the wrong character encoding, which is causing it to completely miss the DOCTYPE declaration (thanks for the clarification David):
character "þ" not allowed in prolog
In XHTML the encoding declaration for your HTML header of utf-16 is
<meta http-equiv="Content-Type" content="text/html; charset=utf-16" />
Currently, in your HTML header you are declaring utf-8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
You have a non UTF-8 character on line 129, so you cannot do this. Additionally, it doesn't match with your files encoding or what your server is claiming the file is.
In your CSS, you should declare the encoding too. This goes on the very first line, before anything else.
@charset "utf-16";
精彩评论