gpt4 book ai didi

css - bootstrap 轮播图像尺寸

转载 作者:行者123 更新时间:2023-11-28 06:11:03 25 4
gpt4 key购买 nike

我对放置在旋转木马中的图像尺寸有疑问。我加载的任何图像(具有不同尺寸 px)我得到的图像在整个旋转木马宽度上都被拉长并且与原始图像不成比例..我应该如何修复 CSS?我可以将图像放在旋转木马的中心而不将其延伸到左/右边界吗?这是我的 CSS:

.carousel {
height: 500px;
margin-bottom: 10px;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
z-index: 100;
}

/* Declare heights because of positioning of img element */
.carousel .item {
height: 500px;
background-color: #FFF;
}
.carousel-inner > .item > img {
position: center;
top: 0;
left: 10;
min-width: 100%;
height: 500px;
}

最佳答案

解决方案是将该 css 代码放入您的 css 文件中

.carousel-inner > .item > img {
margin: 0 auto;
}

关于css - bootstrap 轮播图像尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36176231/

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