制作首页的显示列表。

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)

 

转载于:https://www.cnblogs.com/linf/p/7955796.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值