Firefox不读css

时间:2015-04-14 18:04:14

标签: html css firefox

基本上是标题,尝试在firefox上打开一个页面,从localhost(WAMP)开始,它有一个外部css文件并且没有加载。 这是标题信息:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet"  href="..\include\site.css" id="style">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>

css已经验证为html文件,两者都没有错误。 css适用于IE和Chrome。寻找其他地方的解决方案,但找不到任何有用的东西。

有什么建议吗?

感谢 - 你!

3 个答案:

答案 0 :(得分:3)

您需要在href

中使用正斜杠
 <link type="text/css" rel="stylesheet"  href="../include/site.css" id="style">

答案 1 :(得分:3)

尝试替换斜杠:

<link type="text/css" rel="stylesheet"  href="..\include\site.css" id="style">

为:

<link type="text/css" rel="stylesheet"  href="../include/site.css" id="style">

答案 2 :(得分:1)

嗯,我稍后会更详细地解释一下这一点,这样你或其他任何偶然发现的人都不会感到困惑:

Unix及其变体始终使用正斜杠(/)来表示文件系统层次结构。另一方面,WindowsMS-DOS借用了它的文件系统分隔符,即反斜杠(),恰好是它的前身。

互联网URL路径分隔符被选为斜杠,因为当时的大多数开发人员都熟悉Unix标准。作为路径分隔符的Unix斜杠通常被认为是规范分隔符。正斜杠(/)是基于Web的系统上事实上的路径分隔符。

在您的情况下,链接标记应为:

<link type="text/css" rel="stylesheet"  href="../include/site.css" id="style">

希望这有帮助!!!