Can someone give me a better script for image banners on mobile and desktop to adjust the size?

Topic summary

A user is experiencing issues with image banner sizing across mobile and desktop devices. The second image is not adapting properly to the layout.

Current Problem:

  • Desktop display appears to be working correctly
  • Mobile banner images are not adjusting to the correct size
  • The user’s existing CSS script is not producing the desired responsive behavior

Solutions Offered:

Quick Fix:

  • Change the padding-bottom value from 150% to 100% in the existing CSS code

Mobile-Specific Adjustment:

  • Add custom CSS through Shopify Theme settings
  • Apply a max-height of 370px to the banner content alignment on mobile devices (max-width: 768px)

Status: Multiple community members have reviewed the issue and provided CSS code snippets to resolve the mobile display problem. The discussion includes screenshots demonstrating the current issue and expected results.

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

The prolblem is this not second picture is adapt to image

I now have this script :

  1. .banner__media:first-child {

  2. width: 100%;

  3. }

  4. .banner__media+.banner__media {

  5. display: none;

  6. }

  7. @media screen and (max-width: 749px) {

  8. .banner__media:first-child {

  9. display: none;

  10. }

  11. .banner__media+.banner__media {

  12. width: 100%;

  13. display: block !important;

  14. }

  15. }

  16. @media screen and (max-width: 749px) {

  17. .banner__content::before{

  18. padding-bottom: 150% !important;

  19. }

  20. }

goorde.com

Password:Kurac

Hi @Filip02 ,

I checked and didn’t find the section you described, can you send me a link that shows this?

I will check it.

1 Like

Hi @Filip02

I have checked on your query and see that the Desktop is working as requested now.

Here is the code for adjustment on Mobile.

You can follow this instructions:

  1. Go to Shopify > Theme > Customize

  2. Copy and paste this code on Theme settings > Custom CSS section

@media screen and (max-width: 768px){
div.banner.banner--content-align-center {
    height: 370px !important;
}
}

here is the result:

Desktop : https://prnt.sc/Ua4Lsb2Ttnt5

Mobile: https://prnt.sc/MJAOC77s93Ku

1 Like

Hi @Filip02 ,

You just need to change 150% => 100% . it will display fine.

1 Like