css - 背景和其他 CSS 功能未在 Django 中显示
问题描述
base.html
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DPU</title>
<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}"/>
<style>
h1 {color:red;}
p {color:blue;}
</style>
</head>
<hr>
<h1>Disease Polling Unit</h1>
<hr>
{% block main_content %}
{% endblock %}
</body>
</html>
在将其作为静态文件包含在 base.html 中后,背景、字体未显示。我做错了什么?
民意调查/静态/民意调查/style.css
li a {
color:red;
font-size:20px;
}
body {
background:white url('images:pil1.jpg') no-repeat;
}
解决方案
推荐阅读
- java - 在 Spring 中使用 Bcrypt
- r - 将描述性统计数据与 Anova 汇总相结合并写入同一张 Excel 表
- ios - SFSpeechRecognizer 的多个实例?
- javascript - 省略突变等待函数中的查询解析器
- php - 将 POST 参数传递给 PHP 不起作用
- r - 如何将 hh:mm:ss 格式作为数据帧中的 char 格式转换为整数(用于学生 t 测试)?
- azure-functions - 发布本地 azure 函数时在哪里可以找到我的项目文件?
- python - Python:用于独立和循环继续的通用 try-except 包装器
- inner-join - 使用 openquery 进行多个“内部连接”
- python - .execute("INSERT 给出 OperationalError: 无法打开数据库文件