繁体   English   中英

Chrome无法检测到自举轮播的自动高度

[英]Chrome not detecting auto height for bootstrap carousel

.carousel .carousel-inner .carousel-item img {
  width: 100%;
  height: auto;
}

.carousel .carousel-inner .carousel-item .carousel-img {
  width: 100%;
  height: 400px;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  background-color: red;
}

我上面的代码可以在调整大小时保持自举轮播的长宽比,但不适用于Chrome。

该网页是下一个网页: http : //huertalia.mx/UniversidadesWP/site/index.html如果您使用Safari或Firefox进行测试并调整屏幕大小,则可以正常使用。 如果您使用镀铬,则传送带将无法正常工作。

这是轮播的html代码

  <div style="width: 100%;" id="carouselDocumentationIndicators" class="carousel slide hidden-xs-down" data-ride="carousel">
<div class="carousel-inner" role="listbox">
  <div class="carousel-item active">
    <img class="d-block img-fluid" src="assets/img/index/carousel/1_2.jpg" alt="First slide">
    <div class="carousel-caption left-caption text-left">
      <h4 style="padding-left: 30px;" id="prof-click">SOY UNIVERSITARIO</h4>
    </div>
  </div>
  <div class="carousel-item">
    <img class="d-block img-fluid" src="assets/img/index/carousel/2_2.jpg" alt="Second slide">
    <div class="carousel-caption left-caption text-left">
      <h4 style="padding-left: 30px;" id="prof-click">SOY PROFESIONISTA</h4>
    </div>
  </div>
  <div class="carousel-item">
    <img class="d-block img-fluid" src="assets/img/index/carousel/3_2.jpg" alt="Third slide">
    <div class="carousel-caption left-caption text-left">
      <h4 style="padding-left: 30px;" id="prof-click">SOY EMPRENDEDOR</h4>
    </div>
  </div>
</div>

Display:flex导致移动分辨率出现问题。 我认为您可以从那里删除高度,因为不需要,轮播会根据窗口大小调整大小。 我已附上屏幕截图,您可以在其中查看。 让我知道这是否对您有帮助。 我已经在chrome中测试过 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM