Imitating a blink tag with CSS3 animations
Simulate the blink effect using CSS3 by adjusting element visibility with @keyframes
. Set the opacity
from 1 to 0 for an authentic blink. Use the below mentioned code:
Attach .blink-text
to the desired elements to enable blinking:
That's it! You now have a non-distracting text with a steady blink every second.
##Unlock your full potential with CSS
Slow-fast, you control the blink speed
You're in the driving seat when it comes to controlling the speed of blinking. Fiddle with the animation-duration
and see how it changes blink speed:
Cross-browser compatibility: We've got you covered!
Use vendor prefixes, because browser compatibility is no joke:
Better performance, because who doesn't like a speedy website?
A splash of color to make things interesting
Add some hankey-pankey with colors for blinking:
Don't be a block, be inline
Preserve the inline character of your text with display
:
Sass: Make your CSS do more with less
If you're more advanced, take this opportunity to introduce yourself to Sass. It's nice for managing complex styles and animation can be easily encapsulated with mixins:
It's okay to blink, but remember it could be distracting. Use with caution!
Was this article helpful?