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

Cesare Parmiggiani
Cesare Parmiggiani
8,017 Points

How can i set up the transform-origin even for Firefox

How can i set up the transform-origin even for Firefox?

.badge {

transform-origin: 180 180;

}

Does not work

3 Answers

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hey there,

You'll need to define the transform-origin value in pixels. :)

.badge {
  transform-origin: 180px 180px;
}
Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi there Cesare,

I don't suppose after 6 months you're still working on this problem but for clarity for everyone else you need to put the universal selector in with your new code.

This makes sure all the child elements in your SVG image get the new transform origin property. So you do

.badge * { transform-origin: 180px 180px; }
Cesare Parmiggiani
Cesare Parmiggiani
8,017 Points

Hi Guil!

Thank you for your answer,

I sobstituted

.badge * { transform-origin: 50% 50%; }

with

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

But still i have an issue:

elements seems to take origin from the left up corner still.