<h3 class="hover-2">Hover Me</h3>
.hover-2 {
background-image: linear-gradient(#1095c1 0 0);
background-size: 200% .08em; /* .08em is our fixed height, use what you want */
background-position: 200% 100%;
background-repeat: no-repeat;
transition: background-size .3s, background-position .3s .3s;
}
.hover-2:hover {
transition: background-size .3s .3s, background-position .3s;
background-size: 200% 100%;
background-position: 100% 100%;
}
body {
height: 100vh;
margin: 0;
display: grid;
gap: 20px;
place-content: center;
}
h3 {
font-family: system-ui, sans-serif;
font-size: 3rem;
margin:0;
cursor: pointer;
padding: 0 .07em;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.