css - 带有上一张和下一张图片的 Bootstrap 轮播

标签 css twitter-bootstrap-3 carousel

我找到了这个例子来创建一个带有上一张和下一张图片的引导轮播。

https://codepen.io/glebkema/pen/RKavve

所有图像都是 33%,但我希望它像这样:

10% |     80%      | 10%.

是否可以修改 css 使上一张和下一张图片占宽度的 10%,中间图片占宽度的 80%?

最佳答案

当元素组获得焦点时,它会添加 active 类。所以你可以这样做:

.item.active .item__third:nth-child(1), .item.active .item__third:nth-child(3) {
width:10%;
}

.item.active .item__third:nth-child(2) {
width:80%;
}

或者通常在 .item .item__third 类:

.item .item__third:nth-child(1), .item .item__third:nth-child(3) {
width:10%;
}

.item .item__third:nth-child(2) {
width:80%;
}

关于css - 带有上一张和下一张图片的 Bootstrap 轮播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48749180/

相关文章:

html - Unicode 图标 : sometimes looks like a wrong encoding

javascript - 使用 jQuery 定位特定类

CSS帮助?悬停图像

html - 使用 Bootstrap 的 PrettyPrint 没有响应

jquery - 使用 IE 8 在 Twitter Bootstrap 中制作 Carousel 滑动或淡入淡出

jquery - Bootstrap 3 轮播无法正确显示或更改图像

html - 如何在 IBM Websphere Portal 8 中为自定义主题实现 Twitter Bootstrap Framework?

html - 引导轮播 : open the clicked image

html - 文本垂直对齐

javascript - 图像 slider : maintaining equal height for all images while keeping slider responsive