I’m working with the Symmetry theme and need help setting up a different main banner for tablet on my homepage. We already have separate images for mobile and web, and they display correctly. However, on tablet, the banner image overlaps with the text, so we want to upload a completely separate banner specifically for tablet devices. Can anyone assist with this?
Hello @avaskye
Step 1: Add Custom Banners in HTML/Liquid1. Go to Online Store > Themes > Actions > Edit Code.
-
Open the sections/hero.liquid (or whichever section controls the homepage banner).
-
Add a new image field for the tablet banner in the section schema (if it doesn’t exist).
Example of a schema addition to allow tablet-specific image upload:
liquid:
{ “type”: “image_picker”, “id”: “tablet_banner”, “label”: “Tablet Banner Image” } -
Then, in the Liquid code, modify the section to display the appropriate image based on the device type:
liquid:
Step 2: Add CSS Media Queries for Tablet
Now, use CSS to display the correct image based on the screen size:
-
Open your theme CSS file (base.css, theme.css, or similar).
-
Add the following CSS code to control which image is displayed:
css:
/* Hide desktop and mobile banners on tablets / .banner-desktop { display: block; } .banner-mobile, .banner-tablet { display: none; } / Show tablet banner on tablets / @media (min-width: 768px) and (max-width: 1024px) { .banner-desktop { display: none; } .banner-tablet { display: block; } } / Show mobile banner on smaller screens */ @media (max-width: 767px) { .banner-desktop, .banner-tablet { display: none; } .banner-mobile { display: block; } }my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.