CSS Blink Animation | Simple Blinking Text Or Element
The CSS blink animation creates a flashing effect by toggling the visibility of an element using the @keyframes
rule.
It is useful for attention grabbing text, such as alerts or notifications. You can control the blinking speed and make the animation run infinitely.
Demo blink animation
Blinking Text
.text-style {
font-size: 24px;
color: #056bfd;
font-weight: bold;
display: block;
text-align: center;
}
/* CSS Blink Animation */
.blink {
animation: blink-animation 1s steps(1, start) infinite;
}
@keyframes blink-animation {
50% {
visibility: hidden;
}
}
Smooth Blink Text
.text-style {
font-size: 24px;
color: #056bfd;
font-weight: bold;
display: block;
text-align: center;
}
/* CSS Smooth Blink Animation */
.blink-smooth {
animation: blink_smooth 1s infinite;
}
@keyframes blink_smooth {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
Fast Blink Text
.text-style {
font-size: 24px;
color: #056bfd;
font-weight: bold;
display: block;
text-align: center;
}
/* CSS Fast Blink Animation */
.blink-fast {
animation: blink_fast 0.5s infinite
}
@keyframes blink_fast {
0%, 100% {
opacity: 1
}
50% {
opacity: 0
}
}
Steps Based Blink Text
.text-style {
font-size: 24px;
color: #056bfd;
font-weight: bold;
display: block;
text-align: center;
}
/* CSS Steps Based Blink Animation */
.blink-steps {
animation: blink_steps 1s steps(5, start) infinite;
}
@keyframes blink_steps {
to {
visibility: hidden;
}
}
Related: