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

CSS

Joe Li
Joe Li
1,689 Points

Best method to standardise and crop images in CSS?

Hey all,

I'm looking for a clean solution to standardising and cropping images for a store, using bootstrap. I want my client to be able to upload product images without having to photoshop them to the correct size every time.

I'd like to keep them as a grid as squares.

Any ideas?

Thank you,

Joe

1 Answer

Rhys Kearns
Rhys Kearns
4,976 Points

use the width property?

Joe Li
Joe Li
1,689 Points

No because ideally I want the images to be responsive and editing the width or height squishes the image.

Rhys Kearns
Rhys Kearns
4,976 Points

Then what are you trying to do? Squishy the image will keep the aspect ratio and just make it smaller.