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

HTML Introduction to HTML and CSS (2016) Make It Beautiful With CSS Select and Style Multiple Elements by Class

Ben Sohl
Ben Sohl
5,670 Points

I am trying to copy the code used in the example where the profile photo turns onto my own page.

I am trying to copy the code used in the example where the profile photo turns onto my own page. The code is literally copied and pasted, but I changed the class to match mine. The photo is expanding, but it won't rotate. Here's what I have:

HTML:

<img src="ProfilePic.jpg" class="pic">

CSS:

.pic:hover { transform: scale(1.4) rotate(360deg);}

Any ideas? Thanks!

1 Answer

Flor Antara
Flor Antara
12,372 Points

Hi Ben,

Your code is fine. What happens is that you are not being able to see the rotation effect, because it's set to rotate 360 degrees, meaning that it will end up being in its initial place.

Try another value, like (45deg) for instance.

Also, if you want it to animate while it rotates so you can actually see the effect even if it's going to end up in the same position, you can add a transition to the selector:

.pic{
    transition: transform 1s linear;
}

^ This transitions the transform property.