When I add a black overlay to images, I notice that the edges of the row of images slightly peek out from under the overlay. The size of the images seems to affect this issue differently. Check out the CodePen below to see it in action with Bootstrap 4 CSS & JS loaded. I've also included links to images showing the problem for different screen sizes. Any help or suggestions would be greatly appreciated!
CodePen: https://codepen.io/anon/pen/vMOwLb
HTML
<div class="card-container mx-auto">
<div class="card-deck flex-row flex-nowrap card-deck-topic bkg-color">
<div class="card card-topic">
<a href="#" class="topic-card-box">
<img src="https://images-na.ssl-images-amazon.com/images/I/91V8Nhn8CDL._SL1500_.jpg" class="card-img-top" />
<div class="card-body card-body-topic card-body-topic-align">
<p class="card-sub card-sub-topic-title">Title Here<span class="line-two">Second Line of Text</span></p>
</div>
</a>
</div>
<div class="card card-topic">
<a href="#" class="topic-card-box">
<img src="https://images-na.ssl-images-amazon.com/images/I/91V8Nhn8CDL._SL1500_.jpg" class="card-img-top" />
<div class="card-body card-body-topic card-body-topic-align">
<p class="card-sub card-sub-topic-title">Title Here<span class="line-two">Second Line of Text</span></p>
</div>
</a>
</div>
<div class="card card-topic">
<a href="#" class="topic-card-box">
<img src="https://images-na.ssl-images-amazon.com/images/I/91V8Nhn8CDL._SL1500_.jpg" class="card-img-top" />
<div class="card-body card-body-topic card-body-topic-align">
<p class="card-sub card-sub-topic-title">Title Here<span class="line-two">Second Line of Text</span></p>
</div>
</a>
</div>
</div><!-- END CARD DECK -->
</div><!-- END CARD-CONTIANER -->
CSS
html{
font-size:62.5%;
}
.card-deck{
margin-top:50px
}
.card-container{
max-width:1400px;
width:95%;
}
.card-body{
max-width:250px;
padding-left:10px;
margin-top:-2px;
cursor:pointer;
transition:.3s;
-webkit-transition:.3s;
}
.card-deck{
display: flex;
overflow: auto;
}
img.card-img-top{
max-width:250px;
}
.card{
margin-right:16px;
border:none;
flex: 0 0 auto;
}
.bkg-color{
background-color:purple;
}
.card-block-img{
margin-bottom:1.75rem;
margin-top: 3.2rem;
}
.card-block-txt{
margin-bottom:2.4rem;
}
.card-sub-topic-title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
font-family: 'Lora', "Georgia", "Times New Roman";
color: #fff;
font-size: 2.4rem;
line-height: 3.4rem;
}
.card-body.card-body-topic.card-body-topic-align{
margin-top: 0px;
}
.card-topic{
border:0px !important;
box-shadow: -8px 8px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-left: 10px;
}
.card-body-topic{
background-color: #0000009e;
border:0px !important;
}
.card-topic.card .card-body:hover{
background-color:#000000c7;
border: 0px !important;
}
.card-body-topic-align{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 100%;
width:100%;
}
@media only screen and (min-width: 768px) {
.card-deck {
display: flex;
padding-bottom: 75px;
}
.card-body{
min-width:350px;
}
img.card-img-top{
min-width:350px;
}
.card-block-img{
margin-bottom:6rem;
}
@media only screen and (min-width:992px){
.card-deck .card{
margin-right:15px;
}
.card-body{
min-width:100%;
}
img.card-img-top{
min-width:100%;
}
.card-body-topic-align{
transform: translate(-50%, -50%);
}
.topic-container{
padding-top:95px;
margin:6.4rem 0 10.4rem 0;
}
Images