Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Animating SVG with CSS!
You have completed Animating SVG with CSS!
This animation challenge is a great way to practice what you've learned so far. In this video, I'm going to show you my solution to the challenge.
Update
Modern browsers may display the SVG star animation differently than shown in the video, even when using the exact same code. This is due to changes in how browsers calculate SVG transform origins since this course was originally recorded.
If your stars appear to “drift” or move while scaling/rotating, add the following transform-box rule to your CSS:
.stars * {
transform-origin: 50% 50%;
transform-box: fill-box;
}
This ensures transforms are calculated relative to each individual SVG shape rather than the entire SVG canvas, restoring the intended animation behavior.
Quick Reference
-
translate() – MDN
-
translate3d() – MDN
- Increase Your Site’s Performance with Hardware-Accelerated CSS
Related Videos
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