Html 样式表未在 Mozilla Firefox 中加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14663889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stylesheet not loading in Mozilla Firefox
提问by Isaac Gregson
I'm stumped. Working on a site that isn't loading properly in FireFox. It loads great in Chrome and even IE, but for some reason the stylesheet isn't loading in FireFox.
我难住了。在 FireFox 中未正确加载的站点上工作。它在 Chrome 甚至 IE 中加载得很好,但由于某种原因,样式表没有在 FireFox 中加载。
The site: http://gregsonaccounting.com
网站:http: //gregsonaccounting.com
I'm using html5 code and have used the basic resets and such from html5 Boiler Plate. Not sure if the problem is in my html or CSS.
我正在使用 html5 代码并使用了 html5 Boiler Plate 中的基本重置等。不确定问题出在我的 html 还是 CSS 中。
Any insight is extremelyhelpful.
任何见解都非常有帮助。
Many thanks.
非常感谢。
采纳答案by ThierryT
Your problem comes from style.css which begins by @charset "IBM437"
Replace it with @charset "UTF-8";
and it will be better !
你的问题来自 style.css ,它以@charset "IBM437"
Replace it with开头@charset "UTF-8";
,它会更好!
It seams this charset IBM437 is auto added by SASS:
它接缝这个字符集 IBM437 是由 SASS 自动添加的:
回答by blasteralfred Ψ
A stylesheet should be defined in the format;
应在格式中定义样式表;
<link rel="stylesheet" type="text/css" href="css/stylesheet.css">
You may also include media
attribute, that they specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, etc.
您还可以包括media
属性,它们指定文档如何在不同媒体上呈现:在屏幕上、在纸上、使用语音合成器、使用盲文设备等。
In your page, it is;
在您的页面中,它是;
<link rel="stylesheet" href="stylesheets/style.css" rel="stylesheet" />//Here is the problem
<link rel="stylesheet" href="nivo-slider/nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="nivo-slider/themes/default/default.css" type="text/css" media="screen" />
So that line may be modified like;
因此该行可以修改为;
<link rel="stylesheet" href="stylesheets/style.css" type="text/css" media="screen" />
回答by gregorvand
Try changing:
尝试改变:
<link rel="stylesheet" href="stylesheets/style.css" rel="stylesheet" />
to
到
<link rel="stylesheet" href="stylesheets/style.css" type="text/css" />
回答by Ros?a Klein
My CSS code worked well on Chrome, but it kept crashing on IE and Firefox. Then i found out the problem was in a badly preprocessed CSS.
我的 CSS 代码在Chrome上运行良好,但在 IE 和 Firefox 上一直崩溃。然后我发现问题出在预处理不当的 CSS 中。
Just copy paste your CSS to http://csslint.net/and if you get any error, just fix it and you are good :)
只需将您的 CSS 复制粘贴到http://csslint.net/,如果您遇到任何错误,只需修复它,您就可以了 :)
Worth trying!
值得尝试!
回答by Sefuncoo
insert this inside your html documents. I am not writing in code just giving u the key words so you know and can put it in.
将此插入到您的 html 文档中。我不是在写代码,只是给你关键词,所以你知道并可以把它放进去。
link rel="stylesheet" type="text/css" href="stylesheet.css"
链接 rel="stylesheet" type="text/css" href="stylesheet.css"
it works so make sure you have this correctly or else your html document will not load with your stylesheet. best of luck to you and keep working brah.
它可以工作,因此请确保您正确使用它,否则您的 html 文档将不会与您的样式表一起加载。祝你好运,继续工作。