Currently, I am in the process of coding a layout that requires me to evenly distribute cards next to each other in rows using flex. However, I am encountering an issue with spacing on the right side and I cannot pinpoint the exact reason behind it. After inspecting the element, it appears that the entire card extends to the right without any clear explanation for this behavior. Upon reviewing the CSS code, no additional width is defined on the right side.
<section id="jobs">
<!--Employing cards-->
<div class="container-fluid container-fluid-shorter bg-white">
<!--Assistant card-->
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card width-37">
<div class="card-body d-flex align-items-center justify-content-between">
<h6 class="card-title font-weight-lighter pb-3">Custom units</h6>
<p class="card-text">
<h4 class="text-grey font-weight-light text-capitalize pb-3 pt-3">home page hero</h4>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card width-37">
<div class="card-body d-flex align-items-center justify-content-between">
<h5 class="card-title font-weight-lighter pb-3">Vlastní jednotky</h5>
<p class="card-text">
<h4 class="text-grey font-weight-light text-capitalize pb-3 pt-3">home page hero</h4>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card width-37">
<div class="card-body d-flex align-items-center justify-content-between">
<h5 class="card-title font-weight-lighter pb-3">Vlastní jednotky</h5>
<p class="card-text">
<h4 class="text-grey font-weight-light text-capitalize pb-3 pt-3">home page hero</h4>
</div>
</div>
</div>
</div>
</div>
<!--End of employing cards section-->
</section>
Here are the adjustments I've made to the CSS:
.width-37{
max-width: 37.5vh;
}
.card-body{
padding-left: 0!important;
padding-right: 0!important;
}
I aim to arrange all items within the row with minimal spacing between them, forming rows as specified for different screen sizes (large, medium, small). It seems like the flex item is causing spacing on the right side of each individual item. The dimensions are 480 pixels wide and 180 pixels high, but I desire them to be uniform at 180 x 180 pixels. Can anyone provide insight into why this unexpected spacing is occurring?