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
Ryan Hellerud
3,635 Pointscss animations
trying to follow the blog post from here http://blog.teamtreehouse.com/css-sprite-sheet-animations-steps I can't seem to get my image to animate. Its a 490 X 110 sprite sheet with 7 seperate images. The first image shows up fine but it won't animate.
.ken {
width: 70px;
height: 110px;
background: url('/imgs/ken-shoryuken.png') left center;
animation: play 1.5s steps(7) infinite;
}
@keyframes play {
100% { background-position:-490; }
}
and its positioned with a simple div.
1 Answer
Yulia Markina
12,616 PointsHi Ryan! There is a tiny typo, you forgot to put px or whatever units you want to use. here
@keyframes play {
100% { background-position:-490px; }
}
and another thing that can cause problem is prefixes
animation: play 1.5s steps(7) infinite;
-webkit-animation: play 1.5s steps(7) infinite;
-moz-animation: play 1.5s steps(7) infinite;
-o-animation: play 1.5s steps(7) infinite;
hope it helps.