标签:django col .com span link title load cti head
django的静态文件的引入
1.路径配置
2.静态文件的引入
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <link rel="stylesheet" href="/static/css/crm/index.css"> 7 </head> 8 <body> 9 <form action=""> 10 <p>测试模板页面</p> 11 </form> 12 </body> 13 </html>
在html的头部引入外部静态文件
1 {% load static %} 2 <!DOCTYPE html> 3 <html lang="en"> 4 <head> 5 <meta charset="UTF-8"> 6 <title>Title</title> 7 {# <link rel="stylesheet" href="/static/css/crm/index.css">#} 8 <link rel="stylesheet" href="{% static ‘css/crm/index.css‘ %}"> 9 </head> 10 <body> 11 <form action=""> 12 <p>测试模板页面</p> 13 </form> 14 </body> 15 </html>
在模板的头部写上{% load static %},再在link标签里写入{% static "静态文件的路径" %}
标签:django col .com span link title load cti head
原文地址:https://www.cnblogs.com/ivy-blogs/p/10649615.html