html - 改变背景颜色没有效果
问题描述
我无法使用我的 CSS 样式表更改背景颜色。
这是 HTML(使用 Django);目前在列表中有三个列表。
{% for listing in listings %}
<ul>
<li class="item"><img src="{{ listing.pic}}"> {{ listing }}</li>
<div class="item-description">{{ listing.description }}</div>
</ul>
{% endfor %}
这是CSS
body {
padding: 10px;
background-color: green !important;
}
ul {
list-style: none;
background-color: green !important;
}
.item {
background-color: blue !important;
height: 200px;
}
.item-description {
background-color: purple !important;
}
如您所见,我已经尝试添加 !important 并为元素指定高度。还有一个我尝试删除的引导程序链接。但是,没有任何效果;页面和所有元素保持白色。
解决方案
推荐阅读
- websocket - 如何使 websocket 流广播到许多其他页面?
- nginx - 带有 uwsgi、flask 和 slimxmpp 的 Nginx 服务器
- jquery - 使用 PivotTable.js 在总列中显示平均值
- excel - 如何阻止更改预先格式化的excel中的格式?
- r - “{123, affdsf, 223, 22, dgbwa, 33333}”的格式是什么?
- c# - 在 ASP.NET 中设置日常工作
- windows - Windows 10 平板电脑上的 Windows 窗体应用程序?
- angular - nGINX / Angular 4 HTTP 第一次加载性能
- javascript - 不是 googlemaps api javascript 中的函数错误
- mysql - 如何在 Jasper 上显示多行数据