1 回答

TA貢獻1856條經(jīng)驗 獲得超5個贊
好吧,所以我以為我被卡住了,但后來意識到我可以使用顯示柔性和 z 索引來防止其他圖像重疊。CSS 看起來像這樣;
CSS
.owl-carousel.owl-centered .owl-stage-outer {
position: relative;
padding-top: 100%;
width: 100%;
}
.owl-carousel.owl-centered .owl-stage {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
.owl-carousel.owl-centered .owl-item {
display: flex;
flex-direction: row;
justify-content: center;
height: 100%;
width: auto;
}
.owl-carousel.owl-centered .owl-item.active {
z-index: 999; <-- There it is
}
.owl-carousel.owl-centered .owl-item > img {
height: 100%;
width: auto;
}
希望這可以幫助別人!
- 1 回答
- 0 關注
- 133 瀏覽
添加回答
舉報