【问题标题】:Bootstrap carousel images and sizes引导轮播图像和大小
【发布时间】:2019-06-27 17:11:18
【问题描述】:

我正在尝试展示一个响应式轮播。我在幻灯片中有水平和垂直图像(H 尺寸:1400 x 935。V 尺寸:624 x 935)。

此项目出现问题:https://www.luismatera.art/las-matas-via-muerta-i.html

主要问题是每次幻灯片从水平变为垂直时,文本都会上下移动。

我有这个css代码(提供here):

.carousel-fade .carousel-item, .carousel-item img {max-height: 90vh;}

这个在 src 图片中:

class="d-block img-fluid"

但它不能正常工作

谁能帮我将文本始终保持在同一位置? (如this

提前致谢。

【问题讨论】:

    标签: html css


    【解决方案1】:

    图像的高度不同,因此请尝试添加min-height,这样在更改图像时会有一些一致性:

    .carousel-fade .carousel-item, .carousel-item img {
       max-height: 90vh;
       min-height: 90vh;
    }
    

    【讨论】:

    • 谢谢,塞萨尔。我试过了,但它不能正常工作,水平图像失去了它的比例。
    猜你喜欢
    • 2019-06-21
    • 2013-06-25
    • 2019-05-21
    • 1970-01-01
    • 2021-04-13
    • 1970-01-01
    • 2016-07-17
    • 1970-01-01
    • 2014-11-26
    相关资源
    最近更新 更多