16

I have a very simple situation: fading in / out elements on a page (simple div's, etc.). I know this can be accomplished with opacity with either CSS Transitions or CSS Animations.

Is there any performance difference between the two? I've always used CSS Transitions (mostly because they require fewer lines of CSS, etc.), but I'm wondering if using CSS Animations instead provide any benefit.

1
  • I have a similar question like this, there's also an example of some effects which perform rather bad imo: tinyurl.com/o8hk5br Commented Jun 27, 2013 at 20:39

2 Answers 2

5

Nope, the performance should be just about the same.

opacity changes are handle by the GPU so on most modern browser you'll have a real smooth effect.

Sign up to request clarification or add additional context in comments.

Comments

4

In some cases CSS3 animation is slower than CSS3 transition as some painting work is not lifted to the GPU when using CSS3 animation.

Here you can find a detailed comparison of CSS3 animation vs CSS3 transition.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.