0

1つのテンプレートで別の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 %}

これは可能ですか?

4

1 に答える 1

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 %}
于 2013-03-14T12:15:29.967 に答える