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

制作首页的显示列表

时间:2017-12-01 23:43:56      阅读:428      评论:0      收藏:0      [点我收藏+]

标签:listbox   参数   coff   html   badge   表情   div   问答   聊天   

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

 

        <div class="listbox">
        <ul class="alist">
            <li class="list">
                <a href="#">{{ username }}</a><br>
                <a href="#">Question:{{ title }}</a><br>
                <a href="#">Detail:{{ detail }}</a>
                <span class="badge" style="margin-left: 60%">{{ create_time }}TIME</span>
                <p style="margin-left: 25%"></p>
            </li>
        </ul>
        </div>
@app.route(/base2/)
def index():
    context={
        user:DW,
        title:论表情包的重要性,
        time:2017.12.1,
        detail:活跃语境气氛,增加聊天乐趣,越聊越骚哈哈哈哈哈哈
    }
    return render_template(base2.html,**context)

 

制作首页的显示列表

标签:listbox   参数   coff   html   badge   表情   div   问答   聊天   

原文地址:http://www.cnblogs.com/laifai666/p/7941259.html

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