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

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

OrangeFoodMan
Visitor
2 0 0

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:

OrangeFoodMan_0-1722403490204.png

 

on smaller screen:

OrangeFoodMan_1-1722403529084.png

 

 

Cheers

Replies 10 (10)

Raj-webdesigner
Shopify Partner
363 90 90

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

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

Are you looking for Shopify Developer then your search is over I will help you


If you require further help to optimize your store, please don’t hesitate to reach out.


This contribution will always benefit you and you will get my full help easily and you can contact me easily.


Your Willpower Contribution Link

:-

❤️Tip❤️

Contect On My Mail :-Mail@gmail.com


OrangeFoodMan
Visitor
2 0 0
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
Raj-webdesigner
Shopify Partner
363 90 90

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;
    }
}

Are you looking for Shopify Developer then your search is over I will help you


If you require further help to optimize your store, please don’t hesitate to reach out.


This contribution will always benefit you and you will get my full help easily and you can contact me easily.


Your Willpower Contribution Link

:-

❤️Tip❤️

Contect On My Mail :-Mail@gmail.com


GTLOfficial
Shopify Partner
880 182 192

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
12.png


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

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh

vinh0225
Shopify Partner
138 27 25

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

Was my response useful?  Click Like to let me know!
Was your query resolved? ✓ Mark it as a Resolved Solution
If you need custom Shopify changes, ️you can hire me.
Contact me at  ✉️ jalicorich@gmail.com.

niraj_patel
Shopify Partner
2391 516 517

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 </body> on theme.liquid
<style>
@media screen and (max-width: 749px) {
  .collection-hero__image-container {
      height: 25rem !important;
   }
 }
</style>

niraj_patel_0-1722405542046.png

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

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com

hanji1
Tourist
6 0 1

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!

Sweans
Shopify Partner
429 89 129

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.

 

Sweans_0-1722407118947.png

 

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

 

Sweans_1-1722407135995.png

 

4. Scroll to the bottom of the theme.liquid file, and just above the closing </body> tag, add the following custom CSS code:

 

 

  <style>

      @media screen and (min-width: 750px) {

        .collection-hero__image-container.media>img {

          object-fit: contain;

        }

      }

    </style>

 

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.

 

Sweans_2-1722407160072.png

 

5. 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

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

PageFly-Richard
Shopify Partner
5011 1120 1805

 

Hi @OrangeFoodMan 

 

This is Richard from PageFly - Shopify Page Builder App

 

Please add this code to your theme.liquid above the </head> 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 </head>

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

PageFlyRichard_0-1722407494422.png

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly 

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.

Huptech-Web
Shopify Partner
1169 234 265

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.

Rishihuptech_0-1722428907405.png

Thank you 
K.K

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required