如何移动bootstrap 3轮播字幕下面的图像? [英] How to move bootstrap 3 carousel caption below images?

查看:137
本文介绍了如何移动bootstrap 3轮播字幕下面的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个html使用bootstrap 3显示幻灯片图片:

I have this html that shows slideshow images using bootstrap 3 :

<div class="col-sm-8">



            <div id="myCarousel" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>
                <li data-target="#myCarousel" data-slide-to="2"></li>
                <li data-target="#myCarousel" data-slide-to="3"></li>
                <li data-target="#myCarousel" data-slide-to="4"></li>
                <li data-target="#myCarousel" data-slide-to="5"></li>
            </ol>

            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">
                {% for p in posts %}
                    {% if forloop.counter == 1 %}
                    <div class="item active">
                    {% else %}
                    <div class="item">
                   {% endif %}

                    {% if p.headimage %}
                    <img src="{{ p.headimage.url }}" alt="Image" width="460" height="345">
                     {% endif %}
                      <div class="carousel-caption">
                        <h3>{{ p.title }}</h3>
                        <p>{{ p.teaser }}</p>
                      </div>
                </div>
                {% endfor %}
                </div>

                <!-- Left and right controls -->
                <a class="left carousel-control" href="#myCarousel" 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="#myCarousel" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>

</div>

我想在图片下方显示图片,而不是图片。

I want caption to be shown below the image, not over it.

我试图操纵html和css,但无法实现这一点,所以感谢您的帮助。

I tried to manipulate the html and css but could not achieve this, so appreciate your help.

更新:除了本机bootstrap尝试了这些自定义的css指令(这没有帮助):

Update: Apart from native bootstrap, I have tried these custom css directives (which did not help):

.carousel-inner { padding-bottom:95px; }
.carousel-caption { bottom:-95px; }


推荐答案

绝对相对

.carousel-caption {
    position: relative;
    left: auto;
    right: auto;
}

演示

Demo

这篇关于如何移动bootstrap 3轮播字幕下面的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆