为什么CSS效果不会显示在网页上?

时间:2019-05-19 05:24:32

标签: django django-templates

我正在尝试通过主CSS文件将CSS效果添加到网页上,但是刷新网页时不会显示我希望看到的CSS代码的效果。

HTML代码

{% extends "base.html" %}

{% block content %}

{% block styles %}
<link rel="stylesheet" href="{% static 'css/master.css' %}">
{% endblock %}

<h1>Welcome</h1>
<h2>Login or Sign-up for free to get started!</h2>

{% endblock %}

base.html代码

{% load static %}

<!DOCTYPE html>
{% load staticfiles %}


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="httpss://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>


<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">

<link rel="stylesheet" href="{% static 'css/master.css' %}">


</head>


<body>

<header>
    {% include "header.html" %}
</header>
    <div class="container mycontent">
      {% block content %}

      {% endblock %}

    </div>

    <footer>
    <div class="container">
        {% include "footer.html" %}
    </div>
</footer>



<canvas id="canvas"></canvas>



</body>
<script src="{% static "js/master.js"%}" type="text/javascript" ></script>
</html>

CSS代码

h1, h2 {
color: orange;
}

我希望h1和h2标签中的文本为橙色,但现在为黑色。

0 个答案:

没有答案