制作首页的显示列表。

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

py:

 

def index():
    context = {
        'question':'hehehahaxixihoho'
    }
    return render_template('index.html',**context)

html:

<form class="">
<ul class="list-group list-group-item-light p-3 border border-secondary rounded-top" style="margin-top: 6.2% ; margin-left: 25%;width: 50%; ">
  <li class="list-group-item rounded m-1" style="height: 10ch">
    <span>

        <a href="#">title</a>

        <p>detail{{ question }}</p>
    </span>
  </li>
</ul>
</form>

  

posted @ 2017-12-01 12:52  055刘柏坚  阅读(156)  评论(0编辑  收藏  举报