Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Transitions and Transforms Getting Started with CSS Transforms Animating a CSS Transform

Mayank Munjal
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mayank Munjal
Front End Web Development Techdegree Graduate 18,120 Points

Is it possible to make something rotate permanently?

using the turn property, is it possible to make an image or a logo rotate continuously? if not, any suggestions on how to do that, just curious!

2 Answers

Flor Antara
Flor Antara
12,372 Points

Hi Mayank,

It is possible, yes!

Take a look at this codePen example: https://codepen.io/animatedcreativity/pen/RZexLv

The magic lies behind the single-animation-iteration-count attribute of the animation property (https://developer.mozilla.org/en-US/docs/Web/CSS/animation)

Jan Durcak
Jan Durcak
12,662 Points

omg thats looks like fun xd

You can do some research on the transform property, which has a value called rotate. If you Google something like "how to use css transform: rotate()," you'll likely come across a Stackoverflow post that'll help you. You could also refer to the MDN docs.