My Video Gallery code is almost fully functional, but there's a slight black gap before the image on hover. Is there a way to remove or change this color?
https://i.sstatic.net/T6h8U.png
I'd like to maintain the transition and background color.
Here is the code pen: https://codepen.io/wavyblues/pen/poyBbeL
<!DOCTYPE html>
<title>My Example</title>
<style>
.video-gallery {
position: relative;
margin: 0 auto;
max-width: 1300px;
text-align: center;
}
.video-gallery .gallery-item {
position: relative;
float: left;
overflow: hidden;
margin: 10px 1%;
/* min-width: 500px;
max-width: 800px;
max-height: 360px; */
width: 48%;
background: #000;
cursor: pointer;
}
.video-gallery .gallery-item img {
position: relative;
display: block;
opacity: .45;
width: 100%;
height: 300px;
transition: opacity 0.35s, transform 0.35s;
transform: translate3d(-20px, 0, 0);
backface-visibility: hidden;
}
.video-gallery .gallery-item .gallery-item-caption {
padding: 2em;
color: #fff;
text-transform: uppercase;
font-size: 1.25em;
}
.video-gallery .gallery-item .gallery-item-caption,
.video-gallery .gallery-item .gallery-item-caption > a {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.video-gallery .gallery-item h2 {
font-weight: 300;
overflow: hidden;
padding: 0.5em 0;
}
.video-gallery .gallery-item h2,
.video-gallery .gallery-item p {
position: relative;
margin: 0;
z-index: 10;
}
.video-gallery .gallery-item p {
letter-spacing: 1px;
font-size: 68%;
padding: 1em 0;
opacity: 0;
transition: opacity 0.35s, transform 0.35s;
transform: translate3d(10%, 0, 0);
}
.video-gallery .gallery-item:hover img {
opacity: .3;
transform: translate3d(0, 0, 0);
}
.video-gallery .gallery-item .gallery-item-caption {
text-align: left;
}
.video-gallery .gallery-item h2::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 15%;
height: 1px;
background: #fff;
transition: transform 0.3s;
transform: translate3d(-100%, 0, 0);
}
.video-gallery .gallery-item:hover h2::after {
transform: translate3d(0, 0, 0);
}
.video-gallery .gallery-item:hover p {
opacity: 1;
transform: translate3d(0, 0, 0);
}
@media screen and (max-width: 50em) {
.video-gallery .gallery-item {
display: inline-block;
float: none;
margin: 10px auto;
width: 100%;
}
}
</style>
<div class="content">
<h1 class="section-header">Video Gallery</h1>
<div class="section-header-underline"></div>
<div class="video-gallery">
<div class="gallery-item">
<img src="https://cdn.collider.com/wp-content/uploads/2010/06/inception_movie_poster_banner_04.jpg">
<div class="gallery-item-caption">
<div>
<h2>Inception</h2>
<p></p>
</div>
</div>
</div>
<div class="gallery-item ">
<img src="https://cdn.collider.com/wp-content/uploads/2012/05/dark-knight-rises-movie-poster-banner-catwoman.jpg" alt="Mt. Rainier">
<div class="gallery-item-caption">
<div>
<h2>Dark Knight</h2>
<p></p>
</div>
</div>
</div>
<div class="gallery-item">
<img src="https://i.imgur.com/rD8Unfk.jpg" alt="Olympic National Park">
<div class="gallery-item-caption">
<div>
<h2>Warcraft</h2>
<p></p>
</div>
</div>
</div>
<div class="gallery-item">
<img src="https://thumbor.forbes.com/thumbor/960x0/https%3A%2F%2Fblogs-images.forbes.com%2Fscottmendelson%2Ffiles%2F2017%2F07%2FJustice-League-SDCC-Banner.jpg" alt="Mount St. Helens">
<div class="gallery-item-caption">
<div>
<h2>Justice League</h2>
<p></p>
</div>
</div>
</div>
</div>
</div>