Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Transforming SVG elements with CSS is similar to transforming HTML elements with CSS. You can rotate, scale, skew and translate SVGs using the transform property. In this video, you'll learn how to group SVG shapes and rotate them from a center origin.
Update
If the rotation appears off-center, apply transform-box: fill-box
to your SVG, like so:
.gear-icon {
transition: transform .4s ease-out;
transform-origin: 50% 50%;
transform-box: fill-box;
}
You can learn more about transform-box on MDN.
Quick Reference
Related Videos
Browser Support
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up