How can I resize my collections logo image for mobile view (Refresh Theme)

Topic summary

A Shopify store owner using the Refresh theme needs help making collection hero images display properly on mobile devices. The images look fine on desktop but are being cropped significantly on mobile screens.

Multiple solutions provided:

  • Most common approach: Add CSS to component-collection-hero.css (around line 73) or base.css to adjust the .collection-hero__image-container height for mobile screens (max-width: 749px). Suggested heights range from 20rem to 30rem.

  • Alternative method: Add custom CSS with object-fit: contain property directly to theme.liquid file before the </body> or </head> tag to ensure images resize without cropping.

Follow-up issue: After initial fix, images appeared too small on mobile. The root cause is aspect ratio mismatch - the user’s images have 1:1 ratio while mobile displays need 2:3 ratio. Creating images with proper 2:3 aspect ratio (instead of adding 1024x2048px backgrounds) would resolve the sizing conflict between desktop and mobile views.

The discussion remains ongoing as the user seeks a solution that works well on both desktop and mobile simultaneously.

Summarized with AI on November 7. AI used: claude-sonnet-4-5-20250929.

Hi Everyone,

Could someone please help me with what I need to do to get the hero images for my collections to auto-resize so they look in a mobile view? At the moment its looking fine on my laptop but on my phone its chopping heaps of the image out.

My url is https://yourmarket.net.au/

Any help would be much appreciated.

On laptop:

on smaller screen:

Cheers

add this css in your edit code > base.css file

@media screen and (max-width:767px){
 .collection-hero .media img {
    object-fit: contain;
 }
}

Hello @OrangeFoodMan
Go to online store ---------> themes --------------> actions ------> edit code------->assets-----> component-collection-hero.css ----> line number 73
search this code

@media screen and (max-width: 749px) {
.collection-hero__image-container {
height: 20rem;
}
}

and replace with this code

@media screen and (max-width: 749px) {
.collection-hero__image-container {
height: 30rem !important;
}
}

and the result will be

If this was helpful, hit the like button and mark the job as completed.
Thanks

Hi @OrangeFoodMan

Here is the steps for it:

Step 1. Go to Online Store → Themes → Select a theme → … → Edit code

Step 2. Open assets/component-collection-hero.liquid.

Step 3. Find the following.

@media screen and (max-width: 749px) {
    .collection-hero__image-container {
        height: 20rem;
    }
}

Step 4. update height: 20rem; to height: 100vw.

That’s all.

Regards,

Vinh

Hello @OrangeFoodMan

You can add code by following these steps

  1. Go to Online Store → Theme → Edit code.

  2. Open your theme.liquid file

  3. Paste the below code before on theme.liquid

@media screen and (max-width: 749px) { .collection-hero__image-container { height: 25rem !important; } }

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Hi there! It sounds like you need to adjust the CSS for your hero images to make them responsive. Try setting the images to This should help them resize properly for mobile view. Hope this helps!

Hi @OrangeFoodMan ,

To ensure your hero images resize properly and are fully visible on mobile devices, you can add custom CSS to your theme. Follow these steps:

  1. Go to Online Store > Themes.

  2. Click on Actions next to your current theme and select Edit code.

  1. In the code editor, locate the theme.liquid file. This is typically found under the Layout folder.

  1. Scroll to the bottom of the theme.liquid file, and just above the closing tag, add the following custom CSS code:

The object-fit: contain; property ensures that the image will resize to fit within its container without cropping. If the image still doesn’t fit perfectly, you may consider using other values like cover or adjusting the image’s aspect ratio manually.

  1. Click Save to apply the changes.

This solution ensures that your hero images for collections are properly resized on mobile.

If you need further assistance, feel free to reach out

I hope this helps! If it does, please like it and mark it as a solution!

Regards,
Sweans

Hi @OrangeFoodMan

This is Richard from PageFly - Shopify Page Builder App

Please add this code to your theme.liquid above the to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the


Hope this can help you solve the issue

Best regards,

Richard | PageFly

Hey @OrangeFoodMan, the image you provided has a 1:1 aspect ratio, while the mobile screen you displayed the box on has a 2:3 aspect ratio. Kindly add an image with a 3:2 aspect ratio, instead of 1:1.

Thank you
K.K

Hi Raj,

Thats worked pretty well but now the images appear really small like
in the image below. I’ve been adapting the size of the images to
include a background of 1024px x 2048 px which makes them look good on
the desktop but small on mobile, and when i use the original image it
looks good on mobile but bad on desktop (see below). Is there any way
to make the images adapt to look good in both?

Image 1 is when its good on desktop and small on mobile
Image 2 is when its good on mobile but too big on desktop

Any more help would be amazing

Cheers,
Will

Add This css In edite code > base.css File

@media screen and (max-width: 749px) {
    .collection-hero__inner .collection-hero__image-container {
        height: 30rem !important;
    }
}