gpt4 book ai didi

twitter-bootstrap - Twitter Bootstrap Carousel Image Captions 的定位和样式

转载 作者:行者123 更新时间:2023-12-03 14:27:25 24 4
gpt4 key购买 nike

我正在尝试更改轮播在 Twitter Bootstrap 站点中的位置。我正在尝试将标题放在图像中间(从顶部和左侧对齐)。它现在是对齐的底部。

代码如下:-

<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item active" id="home-carousel-inner">
<img src="media/39440/CHI-3-4-2048x1152-v31931.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>Another dsdaf headline.</h1>
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<a class="btn btn-large btn-primary" href="#">Learn more</a>
</div>
</div>

</div>
<div class="item">
<img src="media/39468/CIH-1-2048x1152-v31931.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>Another example headline.</h1>
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<a class="btn btn-large btn-primary" href="#">Learn more</a>
</div>
</div>
</div>
<div class="item">
<img src="media/32602/CIH-2-2048x1152-1931.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>One more for good measure.</h1>
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<a class="btn btn-large btn-primary" href="#">Browse gallery</a>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>

会是这样的……

enter image description here

现在,它看起来像这样:-

enter image description here

最佳答案

您可以自定义 Bootstrap .carousel-caption CSS..

.carousel-caption {
max-width: 550px;
padding: 0 20px;
margin:0 auto;
margin-top: 200px;
text-align:center;
}

这是 Bootply展示

关于twitter-bootstrap - Twitter Bootstrap Carousel Image Captions 的定位和样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16887484/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com