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

制作首页的显示列表。

时间:2017-12-02 23:21:44      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:bsp   point   smo   好的   首页   ext   add   info   tle   

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

<div class="row clearfix">
        <div class="col-md-4 column">
            <div class="jumbotron well">
                <h1>
                    Hello, world!
                </h1>
                <p>
                    This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.
                </p>
                <p>
                     <a class="btn btn-primary btn-large" href="#">Learn more</a>
                </p>
            </div>
        </div>
        <div class="col-md-8 column" style="background: whitesmoke">
             <p style="color: #FFFFFF">`{{ user }}context</p>
                <ul>
                    <li>
                        <a href="#">{{ user }}</a>
                        <a href="#">{{ title }}</a>
                        <br>
                        <p>{{ detail }}</p>
                        <span>发布时间  longtime ago</span>
                        <span>评论数 100000++++</span>
                    </li>
                </ul>
        </div>
    </div>
</div>
@app.route(‘/‘)
def index():
    context = {
        ‘user‘:‘帅锋锋‘,
        ‘title‘:‘单纯小美好‘,
        ‘detail‘:‘最好的我们‘


    }

    return render_template("index.html",**context)

 

制作首页的显示列表。

标签:bsp   point   smo   好的   首页   ext   add   info   tle   

原文地址:http://www.cnblogs.com/linf/p/7955796.html

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