前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >BBS论坛(十八)

BBS论坛(十八)

作者头像
zhang_derek
发布2019-02-13 16:00:56
4.1K0
发布2019-02-13 16:00:56
举报
文章被收录于专栏:有趣的django有趣的django

18.首页轮播图实现

(1)front/css/front_base.css

代码语言:javascript
复制
.main-container{
    width: 990px;
    margin: 0 auto;
    overflow: hidden;
}
.lg-container{
    width: 730px;
    float:left;
}
.sm-container{
    width: 250px;
    float:right;
}

(2)front_base.html

代码语言:javascript
复制
<link rel="stylesheet" href="{{ url_for('static',filename='front/css/front_base.css') }}">


<div class="main-container">
    {% block body %}

    {% endblock %}
</div>

(3)front_index.html

代码语言:javascript
复制
{% extends "front/front_base.html" %}

{% block title %}
    仙剑论坛
{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{{ static('front/css/front_index.css')  }}">
{% endblock %}

{% block body %}
    <div class="lg-container">
        <div id="carousel-example-generic" class="carousel slide index-banner" data-ride="carousel">
            <!-- 指示器 -->
            <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
            </ol>

            <!-- 轮播图-->
            <div class="carousel-inner" role="listbox">
                <div class="item active">
                    <img src="https://static-image.xfz.cn/1512989310_955.jpg" alt="...">
                    <div class="carousel-caption">
                        ...
                    </div>
                </div>
                <div class="item">
                    <img src="https://static-image.xfz.cn/1528079965_535.jpeg" alt="...">
                    <div class="carousel-caption">
                        ...
                    </div>
                </div>
                ...
            </div>

            <!-- Controls -->
            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>

    <div class="sm-container">

    </div>

{% endblock %}

(4)front/css/front_index.css

代码语言:javascript
复制
.index-banner{
    border-radius: 10px;
    overflow: hidden;
    height: 190px;
}

.index-banner img{
    height: 190px;
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-06-09 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 18.首页轮播图实现
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档