Django load block for css

前端 未结 3 1974
难免孤独
难免孤独 2021-02-04 23:41

I have a few pages. For every page I need load unique css. For all static files I use this. In the head of index.html I have:

{% block css  %}

{% endblock %}
         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 00:45

    Your code needs to be refined.

    You are using double quotes, where you need to use an apostrophe.

    Use

    href ="{% static 'css/contact.css' %} "
    

    Instead of

    href ="{% static" css/contact.css" %} "
    

提交回复
热议问题