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
Maximiliane Quel
Courses Plus Student 55,489 Pointssimple PHP app: sprites and adding nav icons
The last part of the extra credit in the header and footer section asks us to add a new icon. while I generally know how to add an icon as a CSS background the other icons seem to be included as a sprite sheet?
This is the first time I've come across sprites. So I don't really know how to use them, nor do I have an idea how to modify/add to the respective png file. How do I know where to place the icon, what size it should be etc? Is there another advantage to using a sprite other than load time? And if I added an icon just as a new background is it possible that I am inadvertently layering multiple backgrounds, because the sprite file extends into the space for the new icon?
Does anyone know whether sprite sheets have been part of another Treehouse tutorial? If not, does anyone know a good place to start, if I wanted to know more?
Thanks!
2 Answers
James Barnett
39,199 PointsI made you a really simple demo showing how to use sprites.
http://codepen.io/jamesbarnett/pen/HazwF
If you need more info check out this video tutorial on CSS spirites over on level up tuts.
Maximiliane Quel
Courses Plus Student 55,489 PointsThat's amazing! Thanks so much James. Really helpful. And super quick too.