Hello, I am a new member of this community and consider myself an inexperienced coder.
I have encountered an issue with my carousel images and would like them to be centered by height.
The images are larger than the carousel itself, so I want to center them to show the best part of the photo rather than just the upper portion.
Here is my current carousel: example1
And here is how I would prefer it to look (opaque part represents the rest of the image): example2
I hope that explanation makes sense.
Below is the code snippet:
HTML
<!--Carousel Wrapper-->
<div id="carousel-home" class="carousel slide carousel-fade" data-ride="carousel">
<!--Indicators-->
<ol class="carousel-indicators">
<li data-target="#carousel-home" data-slide-to="0" class="active"></li>
<li data-target="#carousel-home" data-slide-to="1"></li>
<li data-target="#carousel-home" data-slide-to="2"></li>
</ol>
<!--Slides-->
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="view">
<img class="d-block w-100 mx-auto" src="imgs/slider/1.png" alt="First slide">
</div>
<div class="carousel-caption">
<h3>Light mask</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100 mx-auto" src="imgs/slider/2.png" alt="Second slide">
<div class="carousel-caption">
<h3>Strong mask</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100 mx-auto" src="imgs/slider/3.png" alt="Third slide">
<div class="carousel-caption">
<h3>Slight mask</h3>
</div>
</div>
</div>
<!--Controls-->
<a class="carousel-control-prev" href="#carousel-home" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel-home" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
CSS:
.carousel-inner
{
width:100%;
max-height:350px;
}
.carousel-caption
{
text-align: center;
bottom: 70%;
}