NetShark
NetShark

Reputation: 1

How to use another style.css in one template?

How to use another style.css in one template?

For example:

{% extends "base.html" %}
{% block content %}
<p>Here I need to use another css file (not the same like on base.html)</p>

{% endblock %}

Is this possible?

Upvotes: 0

Views: 65

Answers (1)

catherine
catherine

Reputation: 22808

base.html

<html> 
<head>
    <title>{% block title %}{% endblock %}</title>
    {% block css %}{% endblock css %}
</head>
<body>
    {% block content %}{% endblock content %}
</body> 
</html>  

other template

{% 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 %}

Upvotes: 3

Related Questions