製做 首頁 顯示 列表 简体版
原文   原文鏈接

1. 在首頁添加顯示問答的列表,並定義好相應的樣式。html

無序列表web

<ul >app

  <li>Coffee</li>ide

  <li>Tea</li>url

  <li>Milk</li>spa

</ul>code

2. 用字典向index.html傳遞參數。htm

 

{% block main%}
<img src="{{url_for('static',filename='images/logo.png')}}" alt="qa">
<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">內容</p>
    </li>
</ul>
{% endblock %}
@app.route('/')
def myweb():
    context={
        'user':lh'
    }
    return render_template("myweb.html",**context)
相關文章
相關標籤/搜索
每日一句
    每一个你不满意的现在,都有一个你没有努力的曾经。
本站公眾號
   歡迎關注本站公眾號,獲取更多信息