Bootstrap Round-circle Class Elements With Border And Padding
I have a bootstrap carousel with multiple items. My html:
Solution 1:
You should put the images inside col divs, and make them responsive using img-fluid
...
<div class="carousel w-100" data-ride="carousel" id="recipeCarousel">
<div class="carousel-inner text-center w-100" role="listbox">
<div class="carousel-item d-flex row active">
<div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
<div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
<div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
</div>
</div>
</div>
Then there will be no overlap.
Solution 2:
Put every image inside a container.
.round-container{
display:inline-block;
margin:10px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>
<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>
<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>
Post a Comment for "Bootstrap Round-circle Class Elements With Border And Padding"