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

制作首页的显示列表。

时间:2017-12-04 20:34:47      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:lis   ack   问答   phi   nbsp   html   ase   group   样式   

1. 在首页添加显示问答的列表,并定义好相应的样式。

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

2. 用字典向index.html传递参数。

 

@app.route(/)
def base():
    context = {
        questions:830830
    }
    return render_template(base.html,**context)

 

 

<p>{{user}} context</p>
<ul class="list-group">
    <li class="list-group-item">
        <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span>
        <a href="#">{{user}}</a>
        <br>
        <a href="#">标题</a>
        <span class="badge">发布时间</span>
        <p style="color:black">内容{{ questions }}</p>
    </li>
</ul>

 

制作首页的显示列表。

标签:lis   ack   问答   phi   nbsp   html   ase   group   样式   

原文地址:http://www.cnblogs.com/arashinoj/p/7941251.html

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