Bootstrap 4 carousel not responsive images

落爺英雄遲暮 提交于 2019-11-28 08:41:19

This is a known issue in Bootstrap 4 Alpha 6...

https://github.com/twbs/bootstrap/issues/21611

As a workaround you can use..

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
  display: block;
}

http://www.codeply.com/go/0QUU06MiIL

ben Thijssen

For me that workaround did not work for both, desktops and mobiles. I adjusted the proposed workaround a bit to make it -orientation- sensible.

@media (orientation: portrait) { 
    .carousel-item.active,
    .carousel-item-next,
    .carousel-item-prev {
        display: block;
        width:100%;
        height:auto;
    }
}

@media (orientation: landscape) { 
    .carousel-item.active,
    .carousel-item-next,
    .carousel-item-prev {
        display: block;
        width:100%;
        height:96vh;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!