首页 > 其他 > 详细

制作首页的显示列表

时间:2017-12-01 12:59:47      阅读:317      评论:0      收藏:0      [点我收藏+]

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

@app.route(/first)
def first():
    context={
        "question":"你若撒野,今生我把酒奉陪"
    }
    return render_template("first.html",**context)
{% extends ‘base.html‘ %}
{% block title %}
首页
{% endblock %}
{% block head %}
   <link href="../static/css/vv.css" rel="stylesheet" type="text/css">
    <script src="{{url_for("static",filename="js/change.js")}}"> </script>
{% endblock %}
{% block main %}
    <body id="myBody">
    <div id="list-container">
        <ul class="note">
            <li>
                <div class="content">
                    <div class="author">
                        <a class="nickname" target="_blank" href="#">nickname</a>
                        <span class="time"></span>
                        </div>
                    </div>
                    <a class="title" target="_blank" href="#">title</a>
                    <p class="abstract">detail{{ question }}</p>
            </li>
        </ul>
    </div>
    <div class="box">
        <a href="" class="nav"><span>关于我们</span></a>
        <a href="" class="nav"><span>意见反馈</span></a>
        <a href="" class="nav"><span>安全保障</span></a>
    </div>
{% endblock %}

 

制作首页的显示列表

原文:http://www.cnblogs.com/yin-yeah/p/7941364.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!