Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Adding two CSS3 animations?

Adding two CSS3 animations?


I am trying to apply a Minecraft-like style to a div element. The end result should look something like the "if not ok then return end" message:


Quick sidenote: For those of you who haven't played the game, a random line from a specific file is read and it's contents are displayed as the message of the day. It throbs in and out and grabs your attention.

The text shadow, font, and throbbing Animation has already been done. However, when I try to apply the second animation, it overrides the throbbing animation (meaning it does not throb, but is rotated)

My CSS is as follows:

#random-message {
    /* font/text stuff */
    animation:minecraft, minecraft-rotate 0.5s infinite;
    -webkit-animation:minecraft 0.5s infinite; /* Safari and Chrome */

The animation minecraft applies a transform: scale effect, and minecraft-rotate applies a transform: rotate effect.

What would be the best way to implement a rotation effect without overriding my throbbing effect?

Problem courtesy of: thatJavaNerd


You don't want to have a rotation want to rotate the div. Simply add transform: rotate(340deg); line to the css block.

Solution courtesy of: Christian


View additional discussion.

This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Adding two CSS3 animations?


Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription