<script src="https://kit.fontawesome.com/a7e9f794eb.js" crossorigin="anonymous"></script>
<div class="container">
<div class="btn">
<div class="btn--content">
<span>Delete</span>
<i class="fas fa-times"></i>
</div>
</div>
</div>
*,*:after,*:before{
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
position: relative;
min-height: 100vh;
width: 100%;
display:flex;
justify-content: center;
align-items: center;
background:#118ab2;
}
.btn{
width: 250px;
max-width: 250px;
height: 60px;
background: #06d6a0;
border-radius: 10px;
box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px;
overflow: hidden;
position: relative;
}
.btn--content{
position: absolute;
width: 100%;
height: 100%;
display:flex;
justify-content: center;
align-items: center;
overflow:hidden;
transition: all 500ms ease;
left:0;
}
span{
color:#ff0054;
font-weight: 600;
font-size: 22px;
text-transform: uppercase;
letter-spacing: 3px;
padding: 0 20px;
text-shadow: 2px 2px 1px #333;
transition: all 500ms ease;
}
i{
color: #ff0054;
border-left: 2px solid #000;
padding-left: 20px;
font-size: 30px;
font-weight: 600;
text-shadow: 1px 1px 2px #333;
}
.btn:hover{
box-shadow: 0 0 5px 1px rgba(17, 17, 26, 0.1);
}
.btn:hover .btn--content{
left: -80px
}
.btn:hover i{
border: none;
font-size: 45px;
}
.btn:hover span{
transform: translateX(-250px);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.