我在“main/static/css/style.css”中链接了我的css文件,我的页面在“main/templates/main/pages.html”中。 但是CSS对某些页面不起作用,比如h2标记没有采用这种样式
{% load static %} <link rel="stylesheet" href="{% static 'css/style.css' %}">
{% extends 'main/base.html' %}
{% block content %}
<div class="main">
<h1><b>Privacy</b></h1>
<div style="height:35px" aria-hidden="true"></div>
<div class="text_para">
<h2 class="h2_privacy">Mission</h2>
<p>paragraph<p>
.......
.main {
-ms-flex: 70%; /* IE10 */
flex: 70%;
background-color: white;
padding: 20px;
}
.text_para {
margin-right: 5%;
text-align: justify;
}
/*heading h2 for privacy page*/
.h2_privacy {
color: black;
font-family: 'Lucida Calligraphy', sans-serif;
}
首先,您需要确保CSS加载正确(例如,从浏览器开发工具的网络部分进行检查)
其次,您需要确保元素位于页面中,并且具有与CSS文件匹配的正确类
检查这两个问题,如果没有发现问题,请更新您的问题
对不起,伙计们,我不活跃了,谢谢你们
是的,我已经在堆栈溢出本身上找到了答案,实际上我没有关闭我的选项卡,所以我认为每次我刷新页面时,它不会完全刷新
我只需要做
ctrl + f5
来绕过缓存,css就会加载更新相关问题 更多 >
编程相关推荐