bootstrap slider img size

问题描述 投票:0回答:1

大家好我开始新学习bootstrap我做了一个带bootstrap 4的网站,我添加了一张幻灯片但照片并没有填满所有页面虽然我写了高度:100;重量:100;在CSS和我尝试身高:汽车;和重量:汽车;但照片的大小是不同的我如何解决它和照片尺寸是不同的。

twitter-bootstrap bootstrap-4 twitter-bootstrap-4-beta
1个回答
0
投票

您需要指定您的身高和(不是'体重')100%(注意percatage)。所以你的css看起来像这样:

.some-class
{
height: 100%;
width: 100%;
}

或者,您可以使用bootstraps预定义类w-100。这是预定义类的示例:

<div class="carousel-item active">
  <img class="d-block w-100" src="https://placeimg.com/640/480/any" alt="First slide">
</div>

Demo

© www.soinside.com 2019 - 2024. All rights reserved.