How can I ensure that carousel pictures are displayed clearly within the box without overflowing? The code I tried resulted in the pictures overflowing from the box and not being visible clearly. How can I resolve this issue?
.container {
width: 1490px;
height: 645px;
margin: 0;
padding: 0;
background: rgba(0,0,0,0.4);
position: absolute;
margin-top: 40px;
}
.sub-container {
width: 1000px;
height: 350px;
margin-left: 280px;
background-color: red;
overflow: auto;
}
<div class="container">
<div class="sub-container">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox" style="max-width:1000px; max-height:350px;">
<div class="carousel-item active">
<img class="d-block w-100" src="aaa.jpg" alt="First slide" style="overflow:hidden;" >
</div>
<div class="carousel-item">
<img class="d-block w-100" src="aaaa.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="aaaaa.jpg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>