码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-11-08 14:45:32      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:输入   char   extend   es2017   name   ima   images   ror   hold   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>
        {% block title %}
        {% endblock %}
        首页</title>

    <link rel="stylesheet" type="text/css" href="{{ url_for(‘static‘, filename=‘css/styles.css‘) }}">
    <script src="{{ url_for(‘static‘,filename=‘js/base.js‘) }}"></script>

    {% block head %}
    {% endblock %}

</head>
<body id="myBody">
<nav>
    <img id="myOnOff" onclick="mySwitch()"
         src="{{ url_for(‘static‘,filename=‘image/base.jpg‘) }}" width="30px">
    <a href="{{ url_for(‘base‘) }}">首页</a>
    <a href="{{ url_for(‘zhuce‘) }}">注册</a>
    <a href="{{ url_for(‘denglu‘) }}">登录</a>
</nav>

        {% block main %}
        {% endblock %}

<div class="area"></div>

<div class="img">
<div>
    <a href="base.html"><img src="{{ url_for(‘static‘,filename=‘image/base1.jpg‘) }}" height="160px" width="240px" align="center"></a>
</div>

</div>

</body>
</html>
{% extends‘base.html‘ %}

{% block head %}
    <link rel="stylesheet" type="text/css" href="../static/css/styles.css">
    <script src="../static/js/denglu.js"></script>
{% endblock %}

{% block title %}
    登录
{% endblock %}

{% block main %}
    <body class="body">
            <div class="box">
        <h2 class="ziti">登录</h2>
        <div class="input_box">
            <input id="uname" type="text" placeholder="请输入用户名">
        </div>
        <div class="input_box">
            <input id="upass" type="password" placeholder="请输入密码">
        </div>
        <div id="error_box"><br></div>
        <div class="input_box">
            <button  onclick="fnLogin()">登录</button>
        </div>
    </div>
</body>
 {% endblock %}
{% extends‘base.html‘ %}

{% block title %}
注册
{% endblock %}

{% block head %}
    <link rel="stylesheet" type="text/css" href="../static/css/styles.css">
    <script src="../static/js/zhuce.js"></script>
{% endblock %}

{% block main %}
    <body class="body">
    <div class="box">
        <h2 class="ziti">注册</h2>
        <div class="input_box">
            <input id="uname" type="text" placeholder="你的用户名">
        </div>
        <div class="input_box">
            <input id="upass" type="password" placeholder="设置密码">
        </div>
        <div class="input_box">
            <input id="upass1" type="password" placeholder="密码">
        <div id="error_box"><br></div>
        <div class="input_box">
            <button  onclick="fnRegist()">注册</button>
        </div>
        </div>
    </div>
</body>
{% endblock %}

技术分享技术分享技术分享

 

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

标签:输入   char   extend   es2017   name   ima   images   ror   hold   

原文地址:http://www.cnblogs.com/loe0506/p/7803597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!