<div class="element">
<div class="inner">
<div class="text">Как я занимался виндсерфингом в Египте</div>
</div>
</div>
.element {
margin: 30px auto;
max-width: 480px;
border: 20px solid #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
font-family: sans-serif;
font-size: 18px;
font-weight: 600;
overflow: hidden;
}
.inner {
background-image: url('https://fruntend.com/storage/photos/1/raimond-klavins.jpg');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 240px;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.5s;
}
.text {
padding: 10px;
border-radius: 3px;
box-shadow: 0 0 5px 0 rgba(255,255,255,0.7);
background-color: rgba(255,255,255,0.7);
transition: transform 0.5s, box-shadow 0.5s;
}
.element:hover .inner {
transform: scale(1.2);
}
.element:hover .text {
transform: scale(0.8);
box-shadow: 0 0 5px 300px rgba(255,255,255,0.7);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.