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 Animating SVG with CSS Keyframe and Line Drawing Animations Creating an SVG Animation Sequence

It doesn't work on Chrome and I don't know why?

5 Answers

Brian Lund
Brian Lund
10,865 Points

Hi Pawel,

I just tried your code in Chrome and it was animated for me, but just made a few adjustments so it was doing it correctly.

I added 'px' to your transform-origin:

.badge * {
    transform-origin: 180px 180px;
}

Also, removed '.badge' from this line of code:

.outer,
.inner,
.inline {
     animation: grow 1s ease-out backwards;
}

Hopefully this helps!

Thanks Brian for the detailed adjustments and help!

Running Chrome 68 on Win7, and it doesn't work for me. I see a little bounce in the inline elements, but it basically just shows the star, and then the rest of the animation pops in a second later. I think it is going from 0-100% with no transitions.

I have added the -webkit- tags, but still no joy. I tried coding it by following along, using the 'finish' code, and using the workspace, and I can't seem to get it working. I even tried adding a -webkit- tag and a normal declaration, and I get nothing.

So that's a thing. I am going to blow through this section for now. If anyone has a fix that works, I will come back and work through it.

this code work well, the unique thing that I made was type the badge together with outer inner e etc, and after I type the vendor -webkit- this still work . /* -------------------------- Keyframes --------------------------- */ @-webkit-keyframes grow { 0% { -webkit-transform: scale(0); } 30% { -webkit-transform: scale(1.1); } 60% { -webkit-transform: scale(0.9); } }

/* -------------------------- SVG Styles --------------------------- */

.badge * { transform-origin: 180px 180px; }

.badge, .outer, .inner, .inline { animation: grow 1s ease-out backwards; }

.inner { animation-delay: .1s; }

.inline { animation-delay: .15s; }

Jan Dudek
seal-mask
.a{fill-rule:evenodd;}techdegree
Jan Dudek
Front End Web Development Techdegree Student 16,350 Points

Hi, I am having the same issue as mentioned above. I tried webkit prefixes, but with no luck. When I add .badge it works in Chrome, but then acts wierdly in Firefox. Anyone found other solution to this?

you can use the transform-box: fill-box; istead type tranform-origin:; , this still work too, but this is only expetimental, I tried to put this and it's work for me.

here follow the link: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-box

Hi, it definitely works - https://jsfiddle.net/vrp2ny0q/

Hmm... your're right! I have no idea why it was not working....

Apparently, in Chrome, I had to add the vendor prefixes to the keyframes and animation declarations. https://stackoverflow.com/questions/24806812/css-keyframes-not-working-in-chrome Then this worked for me running Chrome 65 on a Mac.