Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 11, 2017 03:10 pm GMT

Random Numbers in CSS

I stumbled into an interesting problem the other day. I wanted to animate an element with a random animation-duration. This was the non-randomized starting point:

See the Pen Random numbers CSS #1 by Robin Rendle (@robinrendle) on CodePen.

This is the CSS I wrote to make the animation:

@keyframes flicker {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}

#red {
animation: flicker 2s ease alternate infinite;
}

So far so good. But …


Random Numbers in CSS is a post from CSS-Tricks


Original Link: https://css-tricks.com/random-numbers-css/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks