【问题标题】:Bootstrap css will not load even though it links to css min file即使它链接到 css min 文件,引导 css 也不会加载
【发布时间】:2016-06-26 16:14:28
【问题描述】:

我有一个包含 index.html 的文件夹和一个包含我的 bootstrap.min.css 文件的 css 文件夹和一个包含我的 bootstrap.min.js 和我的 jquery 文件的 js 文件夹,并且由于某种原因 bootstrap 将无法加载或工作.如果我仅将引导 CDN 用于 css,则页面可以正常工作。我不确定最小文件有什么问题。下面是我的代码

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Comming Soon</title>
<link herf ="css/bootstrap.min.css" rel ="stylesheet" media="all">
</head>
<body>
<br>
<br>
<div class="content-wrapper">
<div class = "container">
    <div class = "content"> 
        <div class = "row">
            <div class = "col-xs-12 col-sm-12 col-md-12 col-lg-12"> <!-- always take up all the space -->

                    <div class="panel panel-info">
                        <div class="panel-heading">
                            <div class="panel-title">
                                <h2>Comming Soon!</h2>
                            </div>
                        </div>
                    <center>
                        <div class="panel-body">
                            <h1>Don't worry Marvin is building somthing cool</h1><br>
                            <small>come back soon, in the mean time here is some other of his stuff</small>
                        </div>
                    </div>
                </center>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

编辑: 嘿猜猜所以我的源代码确实有 css/bootstrap.min.css 等,但这不是问题,问题是我需要在该链接上方包含 css/bootstrap.css,我知道为什么,但它修复了它。干杯

【问题讨论】:

  • 你在href中有错字 -> &lt;link herf ="bootstrap.min.css" rel ="stylesheet" media="all"&gt;
  • validator.w3.org/nu 会发现这个问题。

标签: javascript html css twitter-bootstrap


【解决方案1】:

您将href 拼错为herf,它应该是这样的:

<link rel="stylesheet" href="css/bootstrap.min.css">

【讨论】:

    【解决方案2】:

    尝试更改以下行
    &lt;link herf ="bootstrap.min.css" rel ="stylesheet" media="all"&gt;

    &lt;link href ="css/bootstrap.min.css" rel="stylesheet" media="all"&gt;

    【讨论】:

      【解决方案3】:

      如果你的引导文件在 css 文件夹中,你应该使用

      <link href ="css/bootstrap.min.css" rel ="stylesheet" media="all">
      

      【讨论】:

        【解决方案4】:

        由于您的 css 是 css 文件夹,您必须告诉浏览器整个路径,浏览器不会自动选择它。所以定义如下

        <link herf ="css/bootstrap.min.css" rel ="stylesheet" media="all">
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-05-25
          • 2020-02-01
          • 1970-01-01
          • 2018-09-06
          • 2020-09-26
          • 2018-09-08
          相关资源
          最近更新 更多