I'm trying to do two things:
1) Stack two images side by side on a bootstrap carousel
2) I'd like to show 2 images side by side in desktop view and only one image in the mobile view.
Here's my bootply: http://www.bootply.com/6UtgjHqm8f
I added
.carousel-inner .item img {
display: inline-block;
}
Which helps, but my alignment is off. The first image goes way off to the left and crowds the left navigation.
Here's my HTML:
<div class="content-section-b">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive" src="http://www.onvia.com/responsive/apples_01.png" alt="Apples">
<img class="img-responsive" src="http://www.onvia.com/responsive/oranges_01.png" alt="Oranges">
</div>
<div class="item">
<img class="img-responsive" src="http://www.onvia.com/responsive/pears_01.png" alt="Pears">
<img class="img-responsive" src="http://www.onvia.com/responsive/mangos_01.png" alt="Mangos">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
<!-- /.container -->
</div>
<!-- /.content-section-b -->
Here's my CSS:
.content-section-b {
padding: 50px 0;
background-color: #3C5A78;
}
.carousel-control.left {
background-image:none;
}
.carousel-control.right {
background-image:none;
}
problem is with you image css property use inline-block on img tab and every thing will be ok
bootply Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With