标签:nbsp container base bsp class 传递参数 head link styles
1. 在首页添加显示问答的列表,并定义好相应的样式。
无序列表
<ul >
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
2. 用字典向index.html传递参数。
@app.route(‘/first‘) def first(): context={ "question":"你若撒野,今生我把酒奉陪" } return render_template("first.html",**context)
{% extends ‘base.html‘ %} {% block title %} 首页 {% endblock %} {% block head %} <link href="../static/css/vv.css" rel="stylesheet" type="text/css"> <script src="{{url_for("static",filename="js/change.js")}}"> </script> {% endblock %} {% block main %} <body id="myBody"> <div id="list-container"> <ul class="note"> <li> <div class="content"> <div class="author"> <a class="nickname" target="_blank" href="#">nickname</a> <span class="time"></span> </div> </div> <a class="title" target="_blank" href="#">title</a> <p class="abstract">detail{{ question }}</p> </li> </ul> </div> <div class="box"> <a href="" class="nav"><span>关于我们</span></a> <a href="" class="nav"><span>意见反馈</span></a> <a href="" class="nav"><span>安全保障</span></a> </div> {% endblock %}
标签:nbsp container base bsp class 传递参数 head link styles
原文地址:http://www.cnblogs.com/yin-yeah/p/7941364.html