如何在一个模板中使用另一个style.css?
例如:
{% extends "base.html" %}
{% block content %}
<p>Here I need to use another css file (not the same like on base.html)</p>
{% endblock %}
这可能吗?
答案 0 :(得分:3)
<强> base.html文件强>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
{% block css %}{% endblock css %}
</head>
<body>
{% block content %}{% endblock content %}
</body>
</html>
其他模板
{% extends "base.html" %}
{% block css %}
{{block.super}}
//css here
{% endblock css %}
{% block content %}
<p>Here I need to use another css file (not the same like on base.html)</p>
{% endblock content %}