The hight stays at real picture hight.
Here is a demo of the problem (desktops with i.a. Chrome & Opera all stable) on JSFiddle:
https://jsfiddle.net/josmaissan/2e54sbt7/
This is what it looks like:
I'm experiencing the same issue. Worked as expected with alpha 5. Apparently, display: flex
in .carousel-item.active is causing the problem.
You can fix this by overwriting the ".carousel-item.active" selector to display:block;
@Jas-n It's a partly fix.
During the transition it is still to high displayed (only the upper part of the picture is visible), but pops in when transition is finished.
Sorry, Need to add 3 classes which covers the transitions:
.carousel-item.active,
.carousel-item-next,
.carousel-item-prev{
display:block;
}
Will this be fixed in an upcoming release or should we stick with the workaround?
I'd guess this'll be fixed before the next (beta) release.
Great! Thank you very much.
@Jas-n Yes, now it works fine!
Does anyone have a demo of the problem?
@mdo Here is a temperary demo:
http://jossan.home.xs4all.nl/test/carousel-0.html
problems with Chrome, Opera, Vivaldi only.
This is what it looks like:
Here's another example of the issue:
http://www.codeply.com/go/0QUU06MiIL
Interesting too that display:flex
makes it difficult to create a text-only carousel.
http://stackoverflow.com/questions/41543707/text-only-carousel/41550102#41550102
I fixed it by overwriting the size in the img-element directly:
<div class="carousel-item active">
<img class="d-block img-fluid" src="assets/images/slides/slide1.jpeg" alt="First slide" style="width:100%; height:100%">
</div>
it works in chrome 55.x, opera 42.x, firefox 50.1x and safari on mac.
You're right @DeltaOS2, by adding a width- and height style of 100% to each img
it seems to look okay too.
See:
Prevent images in carousel-item to be stretched #21799
Carousel plugin dont save aspect ratio of images #21658
@mdo
Closing as dupe of #21658.
Fixed by #22392
Most helpful comment
Sorry, Need to add 3 classes which covers the transitions:
.carousel-item.active,
.carousel-item-next,
.carousel-item-prev{
display:block;
}