加载静态文件,父模板的继承和扩展

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页
    {% block logintitle %}{% endblock %}
        {% block registertitle %}{% endblock %}
    </title>
    <nav style="background-color: white">
    <ul class="nav nav-tabs">
  <li ><a href="{{url_for('lx')}}">首页</a></li>
  <li><a href="{{ url_for('login') }}">登录</a></li><li><a href="{{ url_for('regist') }}">注册</a></li>
   <li><input type="text" class="form-control"style=" 200px" ></li>
        <button type="button" class="btn btn-default">搜索</button>

</ul>
</nav>
{% block loginhead %}{% endblock %}
{% block registerhead %}{% endblock %}
</head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="{{url_for('static',filename='css/webb.css')  }}">

<body class="body">

    <h1 class="h5" >欢迎进入我的网站
    </h1>
<footer class="foot">
    <div > <a href="#"> 联系我们</a> · <a href="#"> 加入我们</a> ·  <a href="#"> 品牌与徽标 </a> ·  <a href="#">帮助中心</a> · <a href="#">合作伙伴</a></div>
        <div>©2015-2017 广州商学院信息技术与工程学院 / 粤ICP备278953737号-5 / 粤公网安备2015060050046号 /   Smrz 粤公网安备201506050046号 /   Wxb  举报电话:020-66666666</div>
</footer>
</body> </html>

  

{% extends 'lx3.html' %}
{% block logintitle %}登录{% endblock %}
{% block loginhead %}<script type="text/javascript" src="../static/js/js.js"></script>{% endblock %}
{% block loginbody %}
 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet"  type="text/css" href="../static/css/webb.css" >

<h1>

 用户界面

</h1>


<body class="body">

<p id="demo">这是一个段落</p>
<button type="button" onclick="displayDate()">显示日期</button>

<div  class="bigdiv" id="container" >

<div id="header" ><h2 align="center">登陆</h2></div>

<div id="content">


     <div align="center">username:<input id="user" type="text" name="user" placeholder="请输入用户名" ></div> <br>
       <div align="center"> password:<input  id="upass" type="password" name="password" align="center"><br></div>

      <div align="center">  <input type="radio" name="role" value="stu">student
      <input type="radio" name="role" value="tea">teacher <br>
      <input type="checkbox" value="true"><span style="color: blueviolet">rember</span> <a href="www.gzcc.cn"> 登陆问题请点</a></div>  <br>

       <div align="center">
            <button onclick="fuck()">登录</button>
        <input type="button" value="cancel"><br>
       </div>
    <div align="center">
         <div id="error_box"></div><br>
    </div>
</div>
</div>
<footer class="foot">
    <div > <a href="#"> 联系我们</a> · <a href="#"> 加入我们</a> ·  <a href="#"> 品牌与徽标 </a> ·  <a href="#">帮助中心</a> · <a href="#">合作伙伴</a></div>
        <div>©2015-2017 广州商学院信息技术与工程学院 / 粤ICP备278953737号-5 / 粤公网安备2015060050046号 /   Smrz 粤公网安备201506050046号 /   Wxb  举报电话:020-66666666</div>
</footer>
</body> </html>

  

{% extends 'lx3.html' %}
{% block registertitletitle %}注册{% endblock %}
{% block registerhead %}<script type="text/javascript" src="../static/js/js.js"></script>{% endblock %}
{% block registerbody %}

 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet"  type="text/css" href="../static/css/webb.css" >
<base href="www.gzcc.cn"target="_blank">


<h1>
 注册界面
</h1>


<body  id="myBody" >
<div  class="bigdiv" id="container" >
<div id="header" ><h2 align="center">注册</h2></div>

<div id="content">


    <div align="center"> 账号注册:<input id="user" type="text" name="user" placeholder="请输入用户名" ><br></div>
    <div align="center"> 注册密码:<input  id="upass" type="password" name="password" placeholder="请输入密码"><br></div>
    <div align="center"> 确认密码:<input id="upass1" type="password"name="password" placeholder="请确认密码"></div>
      <div align="center">  <input type="radio" name="role" value="stu">student
      <input type="radio" name="role" value="tea">teacher <br>
      <input type="checkbox" value="true"><span style="color: blueviolet">rember</span> <a href="www.gzcc.cn"> 登陆问题请点</a></div>  <br>

       <div align="center">
            <button onclick="zhuce()">注册</button>
        <input type="button" value="cancel"><br>
       </div>
    <div align="center">
         <div id="error_box"></div><br>
    </div>
</div>
</div>
<footer class="foot">
    <div > <a href="#"> 联系我们</a> · <a href="#"> 加入我们</a> ·  <a href="#"> 品牌与徽标 </a> ·  <a href="#">帮助中心</a> · <a href="#">合作伙伴</a></div>
        <div>©2015-2017 广州商学院信息技术与工程学院 / 粤ICP备278953737号-5 / 粤公网安备2015060050046号 /   Smrz 粤公网安备201506050046号 /   Wxb  举报电话:020-66666666</div>
</footer>
</body>
</html>

  

原文地址:https://www.cnblogs.com/zheng01/p/7787383.html