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


Best practise for Adaptive images

I just wanted to know some of the techniques that you use for maintaing high quality jpeg images across different devices

1 Answer

Geoffrey Powell
Geoffrey Powell
15,358 Points

I've also been wondering about this. I've been giving my images a wrapper div and then setting the width of the wrapper to either a max-width or a percentage. I declare the width of the actual image to 100% so it will always fill the wrapper. Not sure if this is the best way to do it, but it seems to work.

Also, in Photoshop I create the images at about twice the size needed for screen and then save them as optimized jpgs.

The only problem with that i think is that manipulating the size in css creates more server requests slowing down the site