I'm currently working on a website layout that includes cards arranged in a row with multiple columns using Bootstrap 4.5. However, I've encountered some unexpected white lines within the borders of the card-img
that I am struggling to eliminate:
https://i.sstatic.net/6icwl.png
After inspecting the CSS code, I noticed that padding is applied to the card-img
, but I'm unsure whether these visible lines are border-related or something else entirely. It seems like they may be coming from their "parent" element.
<div class="row row-flex d-flex row-black align-items-stretch">
<div class="col-md-6 col-xl-4 card-col">
<div class="card border-dark">
<img class="card-img grad-bg1" aria-hidden="true">
<div class="card-img-overlay">
<h1 class="text-center"><i class="fa fa-flask text-light" aria-hidden="true"></i></h1>
<h3 class="card-title">Flask!</h3>
<h5 class="card-text text-center">It's a lab!</h5>
</div>
</div>
</div>
</div>
The respective CSS styles are as follows:
.row-black {
background-color: #000;
color: #fff;
min-height: 286px;
padding-top: 1.61%;
padding-bottom: 1.61%;
padding-left: 6.85% !important;
padding-right: 6.85% !important;
align-items: center;
justify-content: center;
}
.card-col {
margin-top: 1.61%;
margin-bottom: 1.61%;
}
.card {
background-color: transparent !important;
border-radius: 30px;
min-height: 350px;
height: 100%;
max-height: 350px;
border: none !important;
background: transparent;
}
.card-img {
border-radius: 30px;
height: 100%;
border: none !important;
margin: 0;
padding: 10px;
}
.card-img-overlay {
height: 100%;
width: 100%;
padding: 50px;
align-items: center;
justify-items: center;
border: none !important;
}
.card-title {
text-align: center;
border: none;
}
.grad-bg1 {
background: -moz-linear-gradient(135deg, rgba(60, 176, 219, 1) 0%, rgba(6, 26, 85, 1) 100%);
background: -webkit-linear-gradient(135deg, rgba(60, 176, 219, 1) 0%, rgba(6, 26, 85, 1) 100%);
background: linear-gradient(135deg, rgba(60, 176, 219, 1) 0%, rgba(6, 26, 85, 1) 100%);
height: 100%;
width: 100%;
border: none !important;
}