2
Let’s say we have the following template as the basis of a Django project (which will be called here html base.):
{% load staticfiles %}
<html lan="pt-br">
<head>
<link rel="stylesheet" type="text/css" href="{% static 'base/style.css' %}" />
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
This templante has linked a css style sheet in its head that contains the basic template settings .
Below we have an example template that inherits from the basic template (called html form.):
{% extends 'base.html' %}
{% load staticfiles %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
{{ form }}
<button type="submit" >Cadastrar</button>
</form>
{% endblock content %}
Since the template html form. and a block in the body of html base. and has no head, how is it possible to link a style sheet to the components of html form. and still maintain compatibility of the previous stylesheet ?