【发布时间】:2021-02-11 23:20:38
【问题描述】:
我正在尝试使用响应式 Bootstrap 轮播,但由于某种原因,我似乎在移动设备上获得了“滚动”。有人可以对此提出建议吗?
链接在这里:https://mydigitalmidlands.co.uk/vogue-interiors.co.uk/
幻灯片图片设置为背景,CSS如下:
.carousel-item {
height: 100vh;
min-height: 350px;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
这似乎是高度属性“100vh”的问题。如果我降低它,我们会在底部得到一个白色边框。
有没有什么方法可以让轮播幻灯片做出响应,没有滚动或空白?
【问题讨论】:
-
有一个 JS 解决方法,请参阅我的答案的更新,但我不知道这是否可以接受,因为问题仅标记为 css。
标签: css bootstrap-4 carousel responsive