I have this red icon in CSS:
<div><i class="fa fa-circle text-danger"></i> LIVE </div>
How can I animate it to blink on an interval?
You remember in webcams and recorders cameras you can see a red dot blinking when is actually recording? I want the same effect, how can I do that in CSS? is it hard?
For example: http://jsbin.com/loxayazega/edit?html,output
Text Blinking feature can be done by animation property with blinking(any name), blink time, and up to blink time and @keyframes selector beside blinking(any name) same as given in animation and opacity property value.
To add an animated image in HTML is quite easy. You need to use the <image> tag with the src attribute. The src attribute adds the URL of the image. Also, set the height and width of the image using the height and width attribute.
Try using this CSS:
you can change blinker 1.5s
value to control blinking speed.
.Blink {
animation: blinker 1.5s cubic-bezier(.5, 0, 1, 1) infinite alternate;
}
@keyframes blinker {
from { opacity: 1; }
to { opacity: 0; }
}
See JsFiddle. I hope it works for you, thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With