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.

HTML

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