Questions tagged [css-animations]

CSS animations make it possible to animate transitions from one CSS style configuration to another. CSS module describes a way for authors to animate the values of CSS properties over time, using keyframes. The behavior of these keyframe animations can be controlled by specifying their duration, number of repeats, and repeating behavior.

CSS animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components, a style describing the CSS animation and a set of keyframes that indicate the start and end states of the animation's style, as well as possible intermediate waypoints.

Properties

  • animation-delay

  • animation-direction

  • animation-duration

  • animation-iteration-count

  • animation-name

  • animation-play-state

  • animation-timing-function

  • animation-fill-mode

Animations are similar to in that they change the presentational value of CSS properties over time. The principal difference is that while transitions trigger implicitly when property values change, animations are explicitly executed when the animation properties are applied.

Example

p {
  animation-duration: 3s;
  animation-name: slidein;
}
@keyframes slidein {
  from {
    margin-left: 100%;
    width: 300%; 
  }

  to {
    margin-left: 0%;
    width: 100%;
  }
}

References

7488 questions
498
votes
5 answers

Maintaining the final state at end of a CSS animation

I'm running an animation on some elements that are set to opacity: 0; in the CSS. The animation class is applied onClick, and, using keyframes, it changes the opacity from 0 to 1 (among other things). Unfortunately, when the animation is over, the…
Dan
  • 6,022
  • 3
  • 20
  • 28
454
votes
14 answers

How to make blinking/flashing text with CSS 3

Currently, I have this code: @-webkit-keyframes blinker { from { opacity: 1.0; } to { opacity: 0.0; } } .waitingForConnection { -webkit-animation-name: blinker; -webkit-animation-iteration-count: infinite; …
ojek
  • 9,680
  • 21
  • 71
  • 110
275
votes
20 answers

Use CSS3 transitions with gradient backgrounds

I'm trying to transition on hover with css over a thumbnail so that on hover, the background gradient fades in. The transition isn't working, but if I simply change it to an rgba() value, it works fine. Are gradients not supported? I tried using an…
alt
  • 13,357
  • 19
  • 80
  • 120
269
votes
13 answers

css3 transition animation on load?

Is it possible to use CSS3 transition animation on page load without using Javascript? This is kind of what I want, but on page load: image-slider.html What I found so far CSS3 transition-delay, a way to delay effects on elements. Only works on…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
245
votes
8 answers

Stopping a CSS3 Animation on last frame

I have a 4 part CSS3 animation playing on click - but the last part of the animation is meant to take it off the screen. However, it always goes back to its original state once it has played. Anyone know how I can stop it on its last css frame…
user531192
  • 2,541
  • 3
  • 16
  • 6
213
votes
6 answers

Play multiple CSS animations at the same time

How can I have two CSS animations playing at different speeds? The image should be rotating and growing at the same time. The rotation will cycle every 2 seconds. The growth will cycle every 4 seconds. Example Code: .image { position:…
Don P
  • 60,113
  • 114
  • 300
  • 432
182
votes
12 answers

CSS: Animation vs. Transition

So, I understand how to perform both CSS3 transitions and animations. What is not clear, and I've googled, is when to use which. For example, if I want to make a ball bounce, it is clear that animation is the way to go. I could provide keyframes and…
Code Poet
  • 11,227
  • 19
  • 64
  • 97
175
votes
9 answers

CSS3 Spin Animation

I have reviewed quite a few demos and have no idea why I can't get the CSS3 spin to function. I am using the latest stable release of Chrome. The fiddle: http://jsfiddle.net/9Ryvs/1/ div { margin: 20px; width: 100px; height: 100px; …
iambriansreed
  • 21,935
  • 6
  • 63
  • 79
173
votes
38 answers

Blurry text after using CSS transform: scale(); in Chrome

Seems like there has been a recent update to Google Chrome that causes blurry text after doing a transform: scale(). Specifically I'm doing this: @-webkit-keyframes bounceIn { 0% { opacity: 0; -webkit-transform: scale(.3); } 50% { …
Ryan O'Rourke
  • 1,731
  • 2
  • 11
  • 3
169
votes
10 answers

Imitating a blink tag with CSS3 animations

I really want to make a piece of text blink the old-school style without using javascript or text-decoration. No transitions, only *blink*, *blink*, *blink*! This is different from that question because I ask for blinking without continuous…
m93a
  • 8,866
  • 9
  • 40
  • 58
145
votes
23 answers

React - animate mount and unmount of a single component

Something this simple should be easily accomplished, yet I'm pulling my hair out over how complicated it is. All I want to do is animate the mounting & unmounting of a React component, that's it. Here's what I've tried so far and why each solution…
ffxsam
  • 26,428
  • 32
  • 94
  • 144
134
votes
10 answers

Is there any way to animate an ellipsis with CSS animations?

I'm trying to have an ellipsis animate, and was wondering if it was possible with CSS animations... So it might be like Loading... Loading.. Loading. Loading... Loading.. And basically just continue like that. Any ideas? Edit: like this:…
Rey
  • 3,639
  • 5
  • 33
  • 40
132
votes
9 answers

Changing :hover to touch/click for mobile devices

I've had a look around but can't quite find what i'm looking for. I currently have a css animation on my page which is triggered by :hover. I would like this to change to 'click' or 'touch' when the page is resized past width 700px using media…
DannyBoy
  • 1,604
  • 2
  • 13
  • 12
127
votes
5 answers

CSS Animation property stays after animating

I'm trying to get a CSS animation property to stay after completing, is this possible? This is what I'm trying to achieve... The element should be hidden when the user lands on the page, after 3 seconds (or whatever), it should fade in and once the…
SparrwHawk
  • 13,581
  • 22
  • 61
  • 91
107
votes
12 answers

CSS animation delay in repeating

I've recently discovered how to "properly" use CSS animations (previously I dismissed them as not being able to make complex sequences like you could in JavaScript). So now I'm learning about them. For this effect, I'm trying to have a gradient…
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
1
2 3
99 100