As a front-end small white, tinker for a few days front end. Today suddenly found that I believe in something, unexpectedly there is a problem. For example, I wrote a CSS style document under the CSS directory: style.css. Then there was only one sentence:
Body {background-color: #ddd;}
And then I'm going to introduce this external CSS in my HTML file:
<link rel= "stylesheet" type= "Text/css" href= "Css/style.css" >
A refresh in the browser: Wow, Kao. No response, no effect. I checked it several times. This path determines that there is no problem, open Chrome's F12 debugger. Make sure the browser loads the CSS file, and then I open the file and see:
Unexpectedly garbled. Should be the encoding is the format of the problem, but it does not matter. Consulted a front-end small partner, after detecting the current encoding of the Web page:
The Utf-16le encoding is displayed:
After I tried, use the sublime editor to modify the local CSS file encoding format for this utf-16le:
Rewritten the CSS code. Save run: Sure enough, you can do it.
But my HTML I specify is Utf-8, and CSS is utf-16, which makes me very uncomfortable. So I asked the solution. Can be solved, and very simple.
Change the CSS back to utf-8 and edit the code inside. Just when HTML introduces this CSS, it's good to declare the encoding format:
That is, add a property to the link tag: charset= "Utf-8" just fine ... In fact, it's so simple ...
Resolve HTML External Reference CSS file does not take effect