如何更改轮播中图像的高度?
How to change height of images in Carousal?
<Carousel>
<Carousel.Item style={{'height':"300px"}} >
<img style={{'height':"300px"}}
className="d-inline-block w-100 h-100 "
src={'https://media3.giphy.com/media/3oKHWoHCr4VtVI6H0A/giphy.gif'} />
<Carousel.Caption>
</Carousel.Caption>
</Carousel.Item >
<Carousel.Item style={{'height':"300px "}}>
<img style={{'height':"300px"}}
className="d-block w-100"
src={'https://dumynlq1n57zm.cloudfront.net/article/167/e91b583-phpCrKL3N.gif'} />
<Carousel.Caption>
无论哪种 css 样式,我更改图像大小都不会改变,请帮助我。
有什么需要改的请指教
Cards.css
.carousel {
width:110%;
height:600px;
margin: auto;
}
如果你想保持比例,你应该使用:
.carousel {
width:100%;
height: auto;
margin: auto;
}
如果图片没有出现,请显示您的代码。
<Carousel>
<Carousel.Item style={{'height':"300px"}} >
<img style={{'height':"300px"}}
className="d-inline-block w-100 h-100 "
src={'https://media3.giphy.com/media/3oKHWoHCr4VtVI6H0A/giphy.gif'} />
<Carousel.Caption>
</Carousel.Caption>
</Carousel.Item >
<Carousel.Item style={{'height':"300px "}}>
<img style={{'height':"300px"}}
className="d-block w-100"
src={'https://dumynlq1n57zm.cloudfront.net/article/167/e91b583-phpCrKL3N.gif'} />
<Carousel.Caption>
无论哪种 css 样式,我更改图像大小都不会改变,请帮助我。
有什么需要改的请指教
Cards.css
.carousel {
width:110%;
height:600px;
margin: auto;
}
如果你想保持比例,你应该使用:
.carousel {
width:100%;
height: auto;
margin: auto;
}
如果图片没有出现,请显示您的代码。