Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Danny Luna
Danny Luna
5,899 Points

What's best Technique for implementing Images on website

Whats the best technique for including images on my site, not logos or icons but regular images , example images used for post, or about us sections, things like that, should I include them in the html markup, should i include them in the css , should i use sprites? Whats the best practice for optimal performance

1 Answer

If you are taking a performance approach then yes including images in CSS with image sprites is the way to go. But it first starts at optimizing each image, you do this manually to ensure the best quality in the real world but developers use other automated tools to compress images. The only downside is that there is some maintainability issues that come with sprites in terms of changing things and removing or re-sizing. But there are many tools out there that can help. Check out Browser Diet for a complete guide and tools.

Hope this helps