I am facing an issue with my layout consisting of 6 div tags divided into 2 rows of fixed height. Whenever I try to add a margin around the divs, the rightmost div gets pushed down to the next row. How can I solve this problem?
HTML:
<div class="container">
<div class="row">
<div class="col-4 frontPageCells">
hh
</div>
<div class="col-4 frontPageCells">
hh
</div>
<div class="col-4 frontPageCells">
ty
</div>
</div>
<div class="row">
<div class="col-4 frontPageCells">
hh
</div>
<div class="col-4 frontPageCells">
hh
</div>
<div class="col-4 frontPageCells">
ty
</div>
</div>
</div>
CSS:
.frontPageCells{
background-color: white;
height: 200px;
margin: 2px;
}
I attempted to counteract the margin issue by using a negative padding value, but unfortunately, this did not yield the desired result.