制作首页的显示列表。

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

<ul class="list-group">

    <li class="list-group-item" style="width: 800px">
      <span class="glyphicon glyphicon-left" aria-hidden="true"></span>
        <a  href="#" target="_blank">{{ user }}</a>
        <br>
         <a  href="#">{{ title }}</a>
   <a href="#">你好</a><br>
              <p style="">{{ detail }}
    </p>

    </li>


</ul>
@app.route('/')
def index():
    context={
        'user':'hsiang',
        'title':'123”',

    }
    return render_template('1.html',**context)

 

posted @ 2017-11-30 16:12  003蒋宇翔  阅读(74)  评论(0编辑  收藏  举报