-
1. 在首页添加显示问答的列表,并定义好相应的样式。
无序列表
<ul >
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
2. 用字典向index.html传递参数。
-
1 {% extends 'base父模板.html' %} 2 {% block title %}首页{% endblock %} 3 <meta charset="UTF-8"> 4 5 {% block main %} 6 <img src="{{ url_for('static',filename='images/t01c36454988ac309e3.webp') }}" alt="liuyifei"> 7 8 <p>{{ username }}contextx</p> 9 <ul class="list-group" style="align-content: center"> 10 11 <li class="list-group-item"> 12 <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> 13 <a href="#">用户名</a> 14 <br> 15 <a href="#">标题</a> 16 <span class="badge">发布时间</span> 17 <p style="text-indent: 18px">内容</p> 18 </li> 19 20 </ul> 21 {% endblock %}