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

Design

CSS not working?

Does anyone know why this animation would not work? Only bubble3 hover works. It is all on a single svg, and the selectors are correct. Can I only do one transform at once?

svg {
    width: 200px; 
    height: 200px; 
}

.bubble1:hover {
    animation-name: bubble1;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
} 

.bubble2:hover {

    animation-name: bubble2;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.bubble3:hover {

    animation-name: bubble3;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out; 
}

/****** Keyframes *****/ 


@keyframes bubble3 {
    0%   {
        transform: translate(122.66px, 48.21px);
    }
    50%  {
        transform: translate(122.66px, 28.21px);
    }
    100% {
        transform: translate(122.66px, 48.21px);
    }

@keyframes bubble2 {
    0%   {
        transform: translate(39.45px, 107.37px);
    }
    50%  {
        transform: translate(39.45px, 127.37px);
    }
    100% {
        transform: translate(39.45px, 107.37px);
    }


 @keyframes bubble1 {
    0%   {
        transform: translate3d(15.75px, 87.5px);
    }
    50%  {
        transform: translate3d(15.75px, 87.5px);
    }
    100% {
        transform: translate3d(15.75px, 87.5px);
    }

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

You need to close out each of your keyframe animations.

@keyframes bubble1 {
    0%   {
        transform: translate3d(15.75px, 87.5px);
    }
    50%  {
        transform: translate3d(15.75px, 87.5px);
    }
    100% {
        transform: translate3d(15.75px, 87.5px);
    }
}

Each animation exists in it's own block. Hopefully once done all your animations will start to work. :)

OMG lol and I even when through and checked the brackets. Not the outer ones. Thanks!