No More Cropped Collection Photos: A Simple CSS Fix for Zoomed-In Shopify Images
Hey fellow store owners! Ever uploaded a beautiful collection image to your Shopify store, only to find it looking strangely zoomed-in or cropped on your live site? You’re definitely not alone. It’s a super common frustration that popped up in a recent community discussion, and the good news is, there’s often a straightforward fix that doesn't require you to be a coding wizard.
I was following a thread started by DoctorGreenbud, who was pulling their hair out because their "category photos" – which they later clarified were collection photos – were showing up way too zoomed in.
This is a classic example of a theme’s default styling trying to make images fill a space, sometimes at the expense of showing the whole picture.
Why Does This Happen? Understanding
The core of this issue usually boils down to a CSS property called
This is where a tiny bit of custom CSS comes in handy!
The Simple CSS Fix: Getting Your Images to
Thankfully, community member Maximus3 swooped in with a super concise and effective piece of CSS that fixed DoctorGreenbud's problem "like a charm." This snippet overrides your theme's default
This is a classic example of a theme’s default styling trying to make images fill a space, sometimes at the expense of showing the whole picture.
Why Does This Happen? Understanding object-fit
The core of this issue usually boils down to a CSS property called object-fit. Think of it like how a TV or monitor handles different aspect ratios.
object-fit: cover: This is what many themes (including DoctorGreenbud's Studio theme) use by default. It tells the image to fill the entire content box, cropping anything that doesn't fit to avoid empty space. Great for hero banners where you want a seamless look, but not so great for detailed collection images where every pixel matters.object-fit: contain: This is our hero! It tells the image to scale down to fit entirely within the content box, preserving its aspect ratio. If the image and the box have different aspect ratios, you might see some empty space (like letterboxing), but the whole image will always be visible.
First Steps: Checking Theme Settings
Before diving into any code, it’s always smart to check your theme’s built-in options. As Kai_xing, another helpful community member, pointed out, some themes offer settings like "Image ratio" or "Image fit" directly in the theme editor. You'd typically find these under the specific section settings for your collections. DoctorGreenbud, using the Studio theme, confirmed that there were "no settings at all for images in the theme editor or in the collection section."
This is where a tiny bit of custom CSS comes in handy!
The Simple CSS Fix: Getting Your Images to contain
Thankfully, community member Maximus3 swooped in with a super concise and effective piece of CSS that fixed DoctorGreenbud's problem "like a charm." This snippet overrides your theme's default object-fit: cover and replaces it with object-fit: contain specifically for your collection images.
Here's the magic code:
.media > img {
object-fit: contain;
}
How to Implement This CSS in Your Shopify Store:
This is easier than you might think, even if you're "fearful of coding" like DoctorGreenbud was!- Log in to your Shopify Admin: Go to your store's backend.
- Navigate to Themes: In the left sidebar, click on "Online Store" > "Themes."
- Edit Your Theme: Find the theme you're currently using (or preferably, a duplicate theme for testing!) and click "Actions" > "Edit code."
- Find "Custom CSS": In the theme editor, look for a file named
theme.liquidor, more commonly and safely, a section specifically for "Custom CSS." Many modern Shopify themes have a dedicated "Custom CSS" field, often found under "Assets" (e.g.,base.css,theme.css,custom.css) or directly in the theme editor's customization options for certain sections. Maximus3's screenshots show it's often a dedicated section within the theme customizer.
- Paste the Code: Scroll down to the very bottom of your "Custom CSS" file or section and paste the code snippet provided above.

- Save Changes: Click the "Save" button.
- Preview Your Store: Visit your collection pages to see the full images, no longer cropped!