h1 LABEL HOVER
p ↑HOVER HIM!
View Compiled
@import url('https://fonts.googleapis.com/css?family=Palanquin+Dark:700&display=swap');
body {
height: 100vh;
background: #f77754;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Palanquin Dark', sans-serif;
letter-spacing: 0.1em;
}
h1 {
color: #2b2726;
font-size: 5vw;
font-weight: 500;
line-height: 1.2;
cursor: pointer;
}
p {
color: #fff;
padding: 0.8rem 2rem;
font-size: 1rem;
}
/* related to css LABEL HOVER from here. */
h1 {
position: relative;
z-index: 0;
display: inline-block;
transition: 0.2s color;
&:hover {
color: #fff;
}
&::before {
z-index: -1;
position: absolute;
top: 0;
left: 0;
content: '';
display: block;
width: 100%;
height: 100%;
background: #0a516d;
transform: scaleX(0);
transform-origin: right;
transition: 0.3s transform ease-in-out;
}
&:hover::before {
transform: scaleX(1);
transform-origin: left;
}
}
View Compiled
This Pen doesn't use any external CSS resources.