How to have separate images between desktop and mobile?

How to have separate images between desktop and mobile?

samueljoonjung
Tourist
37 0 3

The image banner on the mobile looks really good but it is way too big on the desktop. What I want for the desktop image is to look like this---the image with the wide black background. And the current image for the mobile cuz it looks perfect on mobile right now. How do i make this change? My url is www.whoglobal.shop Beyond Appearances, Into.png

samueljoonjung_0-1740538891241.png

samueljoonjung_1-1740538919994.png

 

Replies 5 (5)

LizHoang
Shopify Partner
1251 158 196

Hi @samueljoonjung  I see it look good 

LizHoang_0-1740540684903.png

 

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Check our Joy Rewards & Loyalty Program

PageFly-Richard
Shopify Partner
4991 1118 1796

Hi @samueljoonjung 

 

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 (min-width: 768px){
#Banner-template--24070163759400__image_banner_B4a783::before, #Banner-template--24070163759400__image_banner_B4a783 .banner__media::before {
padding-bottom: 50%;
}
.banner__media {
height: 50%;
background:#000;
}
.media>img {
object-fit: contain;
}
}
</style>

 

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.

oscprofessional
Shopify Partner
16343 2438 3177

Hi @samueljoonjung ,

You can use the <picture> tag to serve different images based on screen size. This is a clean and efficient way to handle responsive images.

 

Replace your existing banner image code with the following:

 

<picture>
    <!-- Desktop Image -->
    <source srcset="your-desktop-image.jpg" media="(min-width: 769px)">
    <!-- Mobile Image -->
    <img src="your-mobile-image.jpg" alt="Banner Image" class="responsive-banner">
</picture>

 

 

  • The <source> tag specifies the desktop image and applies it only if the screen width is 769px or larger.
  • The <img> tag acts as a fallback, displaying the mobile image by default (for smaller screens).

 

 

 
Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
samueljoonjung
Tourist
37 0 3

Please be more specific. How do i find the existing banner image code. And what is the banner image code?

oscprofessional
Shopify Partner
16343 2438 3177

To find the banner image code:

  1. Inspect the page → Right-click the banner > Inspect > Look for an <img> tag or background image.
  2. Check theme files → Go to Online Store > Themes > Edit Code, then look in sections/banner.liquid, hero.liquid, or theme.liquid.

Replace the existing banner code (if using an <img> tag):

 

<picture>
    <source srcset="your-desktop-image.jpg" media="(min-width: 769px)">
    <img src="your-mobile-image.jpg" alt="Banner Image">
</picture>

 

If it's a background image, you'll need to update the CSS instead.

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...