<div class="container">
<div class="text text1">
<span style="--i:1">H</span>
<span style="--i:2">a</span>
<span style="--i:3">p</span>
<span style="--i:4">p</span>
<span style="--i:5">y</span>
<span style="--i:6"> </span>
<span style="--i:7">x</span>
<span style="--i:8">-</span>
<span style="--i:9">m</span>
<span style="--i:10">a</span>
<span style="--i:11">s</span>
</div>
<div class="text text2">
<span style="--i:1">H</span>
<span style="--i:2">a</span>
<span style="--i:3">p</span>
<span style="--i:4">p</span>
<span style="--i:5">y</span>
<span style="--i:6"> </span>
<span style="--i:7">x</span>
<span style="--i:8">-</span>
<span style="--i:9">m</span>
<span style="--i:10">a</span>
<span style="--i:11">s</span>
</div>
<div class="text text3">
<span style="--i:5">H</span>
<span style="--i:4">a</span>
<span style="--i:3">p</span>
<span style="--i:2">p</span>
<span style="--i:1">y</span>
<span style="--i:0"> </span>
<span style="--i:1">x</span>
<span style="--i:2">-</span>
<span style="--i:3">m</span>
<span style="--i:4">a</span>
<span style="--i:5">s</span>
</div>
<div class="text text4">
<span style="--i:5">H</span>
<span style="--i:4">a</span>
<span style="--i:3">p</span>
<span style="--i:2">p</span>
<span style="--i:1">y</span>
<span style="--i:0"> </span>
<span style="--i:1">x</span>
<span style="--i:2">-</span>
<span style="--i:3">m</span>
<span style="--i:4">a</span>
<span style="--i:5">s</span>
</div>
<div class="text text5">
<span style="--i:5">H</span>
<span style="--i:4">a</span>
<span style="--i:3">p</span>
<span style="--i:2">p</span>
<span style="--i:1">y</span>
<span style="--i:0"> </span>
<span style="--i:1">x</span>
<span style="--i:2">-</span>
<span style="--i:3">m</span>
<span style="--i:4">a</span>
<span style="--i:5">s</span>
</div>
<div class="text text6">
<span style="--i:5">H</span>
<span style="--i:4">a</span>
<span style="--i:3">p</span>
<span style="--i:2">p</span>
<span style="--i:1">y</span>
<span style="--i:0"> </span>
<span style="--i:1">x</span>
<span style="--i:2">-</span>
<span style="--i:3">m</span>
<span style="--i:4">a</span>
<span style="--i:5">s</span>
</div>
<div class="text text7">
<span style="--i:1">H</span>
<span style="--i:2">a</span>
<span style="--i:3">p</span>
<span style="--i:4">p</span>
<span style="--i:5">y</span>
<span style="--i:6"> </span>
<span style="--i:7">x</span>
<span style="--i:8">-</span>
<span style="--i:9">m</span>
<span style="--i:10">a</span>
<span style="--i:11">s</span>
</div>
</div>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
width: 100%;
min-height: 100vh;
position: relative;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
overflow: hidden;
background: linear-gradient(
90deg,
hsla(333, 100%, 53%, 1) 0%,
hsla(33, 94%, 57%, 1) 100%
);
}
.text {
position: relative;
margin: 100px 50px;
}
.text span {
color: #fff;
text-shadow: 3px 3px 3px #000;
font-size: 40px;
display: inline-block;
text-align: center;
width: 40px;
text-transform: uppercase;
transform: rotateY(0) translateZ(0);
transition: transform 100ms ease;
}
/* Style 1 */
.text1 span {
position: relative;
color: #fff;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text1:hover span {
color: #146b3a;
}
.text1 span::before {
content: "";
position: absolute;
width: 100%;
bottom: 0px;
height: 2px;
left: 0px;
background: #146b3a;
transition: bottom 500ms ease;
transition-delay: calc(100ms * var(--i));
}
.text1:hover span::before {
bottom: 100%;
}
/* Style 2 */
.text2 {
border-top: 4px solid #146b3a;
border-bottom: 4px solid #146b3a;
}
.text2 span {
position: relative;
display: inline-block;
color: #fff;
transition: color 200ms linear;
transition-delay: calc(50ms * var(--i));
}
.text2:hover span {
color: #146b3a;
}
.text2 span::before {
content: "";
position: absolute;
width: 100%;
height: 2px;
left: 0px;
background: #146b3a;
transition: bottom 200ms ease, top 200ms ease;
transition-delay: calc(50ms * var(--i));
}
.text2 span:nth-child(odd)::before {
top: -2px;
}
.text2 span:nth-child(even)::before {
bottom: -2px;
}
.text2:hover span:nth-child(odd)::before {
top: 100%;
}
.text2:hover span:nth-child(even)::before {
bottom: 100%;
}
/* Style 3 */
.text3 span {
position: relative;
display: inline-block;
color: #fff;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text3:hover span {
color: #f8b229;
}
.text3 span::before {
content: "";
position: absolute;
width: 100%;
height: 2px;
left: 0px;
top: 0px;
background-color: #f8b229;
transition: top 500ms ease;
transition-delay: calc(100ms * var(--i));
}
.text3:hover span::before {
top: 100%;
}
/* Style 4 */
.text4 span {
z-index: 2;
position: relative;
display: inline-block;
color: #fff;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text4:hover span {
color: #f8b229;
}
.text4 span::before {
content: "";
z-index: -1;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #f8b229;
transition: top 500ms ease, opacity 500ms ease;
transition-delay: calc(100ms * var(--i));
}
.text4:hover span::before {
top: 100%;
opacity: 0;
}
/* Style 5 */
.text5 span {
z-index: 2;
position: relative;
display: inline-block;
color: #165b33;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text5:hover span {
color: #fff;
}
.text5 span::before {
content: "";
position: absolute;
z-index: -1;
width: 100%;
height: 0px;
left: 0px;
background: #165b33;
transition: height 500ms ease, box-shadow 500ms ease;
transition-delay: calc(100ms * var(--i));
}
.text5 span:nth-child(odd)::before {
top: 0px;
}
.text5 span:nth-child(even)::before {
bottom: 0px;
}
.text5:hover span:nth-child(odd)::before,
.text5:hover span:nth-child(even)::before {
height: 100%;
box-shadow: 1px 1px 1px 1px #000;
}
/* Style 6 */
.text6 span {
z-index: 2;
position: relative;
display: inline-block;
color: #165b33;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text6:hover span {
color: #fff;
}
.text6 span::before {
content: "";
position: absolute;
z-index: -1;
width: 100%;
height: 0px;
bottom: 0px;
left: 0px;
box-shadow: 1px 1px 1px 1px transparent;
background: #165b33;
transition: height 500ms ease, box-shadow 500ms ease;
transition-delay: calc(100ms * var(--i));
}
.text6:hover span::before {
height: 100%;
box-shadow: 1px 1px 1px 1px #000;
}
/* Style 7 */
.text7 span {
z-index: 2;
position: relative;
display: inline-block;
color: #fff;
margin: 0px 2px;
transition: color 500ms linear;
transition-delay: calc(100ms * var(--i));
}
.text7:hover span {
color: #f8b229;
}
.text7 span::before {
content: "";
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
bottom: 0px;
left: 0px;
background: #444;
box-shadow: 1px 1px 1px 1px #000;
transition: transform ease 1s, background-color ease 1s;
transition-delay: calc(100ms * var(--i));
}
.text7:hover span::before {
background-color: #165b33;
transform: rotateY(180deg);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.