标签:html logs button lan style input 商学院 name inpu
夜间模式的开启与关闭
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>夜晚模式</title> <script> function mySwitch(){ var oBody = document.getElementById("myBody"); var oOnOff = document.getElementById("myOnOff"); if(oOnOff.src.match("bulbon")){ oOnOff.src="http://pic.58pic.com/58pic/15/59/25/04E58PICcfu_1024.png"; oBody.style.background="black"; oBody.style.color="blue"; }else{ oOnOff.src="http://pic.58pic.com/58pic/15/59/25/04E58PICcfu_1024.png"; oBody.style.background="black"; oBody.style.color="red"; } } </script> </head> <body id="myBody">
2.父模板的制作
a.制作网站网页共有元素的父模板html,包括顶部导航,中间区块划分,底部导航,底部说明等。
b.汇总相关的样式形成独立的css文件。
c.汇总相关的js代码形成独立的js文件。
d.形成完整的base.html+css+js
from flask import Flask,render_template app = Flask(__name__) @app.route(‘/‘) def index(): return render_template(‘index.html‘) @app.route(‘/zhuce/‘) def zhuce(): return render_template(‘zhuce.html‘) @app.route(‘/denglu/‘) def denglu(): return render_template(‘denglu.html‘) if __name__ == ‘__main__‘: app.run(debug=True) 复制代码 复制代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登录界面</title> <link rel="stylesheet" type="text/css" href="../static/css/vvv.css"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="../static/js/ggg.js"></script> </head> <body id="myBody"> <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">广州商学院</a> </div> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="输入您感兴趣的"> </div> <button type="submit" class="btn btn-default">查询</button> </form> <button type="button" class="btn btn-default navbar-btn">导航栏</button> <ul class="nav navbar-nav navbar-right"id="myBody"> <li ><img id="myOnOff" onclick="mySwitch()" src="http://www.runoob.com/images/pic_bulbon.gif" width="20px">夜间模式</li> <li><a href="#"><span class="glyphicon glyphicon-user"></span> 注册</a></li> <li><a href="登录页面.html"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li> <li><a href="#"><span class=""></span> 退出</a></li> </ul> </div> </nav> <div class="div1"> <div class="div2">登录</div> <div class="div3"> <div class="iconfont ic-user"></div> 用户:<input id="username" type="text" placeholder="请输入用户名"> </div> <div class="div3"> 密码:<input id="userpass" type="text" placeholder="请输入密码"> </div> <div id="error_box"><br></div> <div class="div3"> <button onclick="myLogin()">登陆</button> </div> </div> <br> <div id="bottom"> <a href="">联系我们</a> <a href="">加入我们</a> <a href="">帮助中心</a> <a href="">合作伙伴</a> </div> <div class="copyright"> <p>Copyright © 2017. Created by <a href="#" target="_blank">ben</a></p> </div> </body> </html>
标签:html logs button lan style input 商学院 name inpu
原文地址:http://www.cnblogs.com/qq724852210/p/7780731.html