<button class="btn">
<img src="https://assets.codepen.io/1425525/379536_bell_icon.png" class="mr-10" />
<p class="btn-scale-hover">Это абсолютно бесплатно</p>
</button>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
overflow: hidden;
font-family: sans-serif;
}
.btn {
display: flex;
align-items: center;
padding: 10px 30px;
border: none;
color: #212529;
background: transparent;
cursor: pointer;
}
.mr-10 {
margin-right: 10px;
}
.btn-scale-hover {
padding: 10px;
transform: scaleX(0);
transform-origin: left top;
color: #fff;
background: #47cf73;
transition: 1s;
}
.btn img:hover ~ .btn-scale-hover {
transform: scaleX(1);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.