简体   繁体   English

Django:引导类加载但不是我的风格。css

[英]Django: Bootstrap classes loading but not my style.css

Here is my HTML file:这是我的 HTML 文件:

{% load static %}
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>{% block title %}{% endblock %}</title>

    <!-- Link to Bookstrap and stylesheet -->
    <link rel='stylesheet' href="{% static 'css/bootstrap.min.css' %}">
    <link rel='stylesheet' href="{% static 'css/style.css' %}">
    <script src="{% static 'js/bootstrap.min.js' %'}"></script>

  </head>
  <body class="bg-blue">

    <div class="container">
      <div class ="row">
        <div class ="col-lg-4 col-lg-offset-4">
          <br/>
          <br/>
          <br/>
          <div class="panel panel-body">
            <div class="panel-body">
              <h3 class="text-center text-uppercase"><b> {% block heading %}{% endblock %}</b></h3>
              <br/>
              {% block content %}{% endblock %}
          </div>
        </div>
      </div>
  </body>
</html>

I want to use the "bg-blue" class defined in my style.css.我想使用在我的 style.css 中定义的“bg-blue”class。

.bg-blue{
  background-color: #3F3F63;
}

However it doesn't work.但是它不起作用。 My boostrap and style.css are in the same folder.我的 boostrap 和 style.css 在同一个文件夹中。 The Bootstrap loads, for example my text in centered and uppercase and the font is different. Bootstrap 加载,例如我的文本居中和大写,字体不同。

I've also tried putting the class directly in the html file, and that works, but I want to be able to use style.css.我也尝试将 class 直接放在 html 文件中,这可行,但我希望能够使用 style.css。

Edit: it works in Firefox but not Chrome, so it's not the code, any explain to this?编辑:它适用于 Firefox 但不适用于 Chrome,所以它不是代码,对此有何解释?

that is because you forgot to clear cache in chrome.press control + F5 to clear cache and load again.那是因为您忘记在 chrome.press 中清除缓存。按control + F5清除缓存并再次加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM