<div class="parent">
<div class="div div1">
<img src="https://avatars.mds.yandex.net/get-pdb/2005597/1f580e34-4779-41ae-8447-48e8a1eb9fca/s1200?webp=false" alt="">
<h3>Модное нижнее бельё</h3>
<div class="play"></div>
<a href="#" class="hide">Смотреть коллекцию</a>
</div>
<div class="div div2">
<img src="https://avatars.mds.yandex.net/get-pdb/881477/e830eaaa-ea2e-4ead-9b50-fa14afb87f73/s1200?webp=false" alt="">
<h3>Рубашки</h3>
<div class="play"></div>
<a href="#" class="hide">Смотреть коллекцию</a>
</div>
<div class="div div3">
<img src="https://www.nastol.com.ua/pic/201712/1024x1024/nastol.com.ua-261539.jpg" alt="">
<h3>Шорты</h3>
<div class="play"></div>
<a href="#" class="hide">Смотреть коллекцию</a>
</div>
<div class="div div4">
<img src="https://static.tildacdn.com/tild6137-3862-4636-a464-393662313038/0P2A3830-min.jpg" alt="">
<h3>Джинсы Рокко</h3>
<div class="play"></div>
<a href="#" class="hide">Смотреть коллекцию</a>
</div>
</div>
.parent {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(4, 1fr);
grid-gap: 6px;
max-width: 768px;
height: 90vh;
margin: auto;
}
.div1 { grid-area: 1 / 1 / 3 / 3; }
.div2 { grid-area: 3 / 1 / 5 / 2; }
.div3 { grid-area: 3 / 2 / 5 / 3; }
.div4 { grid-area: 1 / 3 / 5 / 4; }
.div1{background: red;}
.div2{background: green;}
.div3{background: blue;}
.div4{background: yellow;}
.div{
position: relative;
overflow: hidden;
}
.div img{
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.div h3{
transition: 0.34s linear;
position: absolute;
bottom: 10px;
left: 20px;
color: #fff;
z-index: 10;
}
.div .hide{
position: absolute;
top: 100%;
left: 20px;
transition: 0.34s linear;
border: 1px solid;
padding: 6px 10px;
color: #fff;
text-decoration: none;
z-index: 10;
}
.play{
transition: 0.34s;
}
.div:hover .play{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 0;
}
.div:hover h3{
transform: translateY(-30px);
}
.div:hover .hide{
transform: translateY(-45px);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.