簡體   English   中英

Bootstrap Carousel 的高度跳躍

[英]Bootstrap Carousel jumps in height

我有一個react-bootstrap輪播。

它在滾動時會跳躍,因為圖像具有不同的大小,但是如果我給它們大小weight: 1309pxheight: 730px - 我失去了響應能力,並且在每個設備上只有730pxheight並且它不會調整大小以進行響應.

如何修復它以使每張圖片的大小相同(不允許輪播跳躍)並保持響應能力?

看看圖片,以及箭頭如何在不同的高度跳躍:

![Bootstrap Carousel 截圖][1]

這是我的代碼:

 <div id="carousel-container"> <Carousel> <Carousel.Item> <img src={firstImg} /> <Carousel.Caption> <h3>Niagara Falls</h3> <p>One of the most famous wonders of nature is Niagara Falls.</p> </Carousel.Caption> </Carousel.Item> <Carousel.Item> <img src={secondImg} /> <Carousel.Caption> <h3>Monuments Valley</h3> <p>Monument Valley is a region of the Colorado Plateau characterized by a cluster of vast sandstone buttes.</p> </Carousel.Caption> </Carousel.Item> <Carousel.Item> <img src={thirdImg} /> <Carousel.Caption> <h3>Grand Canyon</h3> <p>The Grand Canyon is a famous canyon in Arizona.</p> </Carousel.Caption> </Carousel.Item> </Carousel> </div>

嘗試在你的 img 中使用className="d-block w-100"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM