标签:color tag 导入 height bsp lock class nbsp 内容
模板(名为master.html):
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" href="#"> .. <style> .pg-header{ height: 48px; background-color: #eeeeee; color:blue; } </style>{% block css %}{% endblock %} </head> <body> <div class="pg-header">主机管理</div>{% block content %}{% endblock %} <div class="pg-footer"></div> <script src="#"></script>{% block js %}{% endblock %} </body> </html>
继承:
{% extends ‘master.html‘} {#继承谁#} {% block title %}自定义标题{% endblock %} {% block css %} <style> .pg-header{ {#自己的css#} } </style> {% endblock %} {% block content %}内容{% endblock %} {% block js %} <script> {#自己的js#} </script> {% endblock %}
{% include "tag.html"}{#写上要导入的html#}
标签:color tag 导入 height bsp lock class nbsp 内容
原文地址:http://www.cnblogs.com/special-li/p/7867579.html