[英]import css using 'static' template in Django
I have been importing JS files into my template using: 我一直在使用以下方法将JS文件导入模板:
<script src="{% static 'inventory/js/panel.js' %}" type="text/javascript"></script>
while importin CSS using 而导入CSS使用
<link href="{{ STATIC_URL }}common/css/form.css" rel="stylesheet" type="text/css">
Can you tell me how to import CSS files using the static template tag like in importing JS files. 您能告诉我如何使用静态模板标记导入CSS文件,就像导入JS文件一样。 Thanks
谢谢
It's almost the same as your js: 与您的js几乎相同:
{% load staticfiles %}
<link href="{% static "css/base.css" %}" rel="stylesheet"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.