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 animation is snappy

I'm doing an animation in css on an ing to change the border radius here is the code

.skills-set img {
    border-radius: 130px;
}


.skills-set img:hover {
    border-radius: 5px;
    -webkit-transition: border-radius 1s ease;
    transition: border-radius 1s ease;
}

The animation works but once the mouse leaves the img it doesn't smoothly transition back to the original border for the image could someone help

1 Answer

You have to add the transition to the original element as well for a "smooth" transition, like so:

.skills-set img {
    border-radius: 130px;
    -webkit-transition: border-radius 1s ease;
    transition: border-radius 1s ease;
}


.skills-set img:hover {
    border-radius: 5px;
    -webkit-transition: border-radius 1s ease;
    transition: border-radius 1s ease;
}

Thanks a lot man