While working on a grid layout using Bootstrap styles, I encountered an issue with the col-sm- *
classes where the divs appeared too close together and the shadow effect I applied was getting lost. Adding margin to the div helped but caused the last div to break off, which was not what I intended. Some suggested using the border property to address this, but I needed it for other purposes. I also considered using the outline property to blend it with the background color, but I am still unsure of how to implement it properly. Here is a comparison before and after adding margin.
Upon researching on SO, I found many solutions involving the border property, but as mentioned earlier, I had already allocated it for different functionalities.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-sm-4 shadow p-5 bg-light border">
CONTENT
</div>
<div class="col-sm-4 shadow p-5 bg-light border">
CONTENT
</div>
<div class="col-sm-4 shadow p-5 bg-light border">
CONTENT
</div>
</div>
</div>
<hr>
<div class="container">
<div class="row">
<div class="col-sm-4 shadow p-5 bg-light border m-1">
CONTENT
</div>
<div class="col-sm-4 shadow p-5 bg-light border m-1">
CONTENT
</div>
<div class="col-sm-4 shadow p-5 bg-light border m-1">
CONTENT
</div>
</div>
</div>