gpt4 book ai didi

html - 如何在 Bootstrap 轮播中使用 100% 宽度图像防止动画期间的高度变化

转载 作者:太空宇宙 更新时间:2023-11-04 11:52:23 24 4
gpt4 key购买 nike

Bootstrap 3 轮播应该在动画期间使用固定高度的图像。Carousel 是使用 bootstrap 教程中的代码创建的

 <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<a href="124">
<img class="carousel-img" src="124" />
</a>
</div>
<div class="item ">
<a href="123">
<img class="carousel-img" src="123" />

</a>
</div>
</div>
</div>

图像宽度设置为轮播宽度使用来自

的回答

How to center image in carousel

.carousel-img {
width: 100%;
height: auto;
}

我的屏幕分辨率大,缩放级别小,动画图像高度降低。如何使用固定高度让内容不跳转?

最佳答案

只需添加此 CSS,

.carousel-inner > .item{
width: 100%;
}

关于html - 如何在 Bootstrap 轮播中使用 100% 宽度图像防止动画期间的高度变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30544176/

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