Shopify Slideshows on Mobile: Two Pro Solutions for Perfect Display

Alright, fellow store owners! Let's talk about something that can be a real headache: getting your beautiful homepage slideshow images to look just right on mobile. You spend ages picking the perfect shots, crafting your message, and then… you pull it up on your phone, and it's just… off.

This is a super common challenge, and it recently popped up in a Shopify community discussion titled originally, "Trouble with Slideshow Image Display on Mobile." Our friend, PeppePro02, kicked off the thread with a clear plea for help, showing us exactly what they were up against. They had tried the "stick below the text" option, which made the full image visible, but as you can see from their screenshots, it created an awkward visual break and just didn't feel right proportion-wise.

Luckily, the community stepped up with some fantastic advice, and even PeppePro02 found a solid workaround. Let's dive into the two main solutions that came out of that discussion, so you can make your mobile slideshows absolutely pop.

Solution 1: The Quick CSS Tweak for Better Image Fitting

PeppePro02 actually shared their own fix right at the start of the thread (a classic move when you figure it out mid-post!). Their solution involves a bit of CSS to control how your slideshow images behave on smaller screens. This is a great, straightforward approach if your main goal is to simply adjust how your existing images fill their container on mobile, rather than using entirely different images.

How it Works:

This CSS snippet targets the image within your slideshow media element when the screen width is 749 pixels or less (which generally covers most mobile devices). The object-fit: cover; property tells the image to fill the entire content box, cropping parts of the image if necessary to maintain its aspect ratio. Then, object-position: left center; tells the browser which part of the image to prioritize – in this case, the left and center. You can play around with object-position (e.g., center center, top center) to find what looks best for your specific images.

Step-by-Step Instructions:

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Find your current theme, click Actions > Edit code.
  3. Look for a file like theme.scss.liquid, base.css, or a similar CSS file within your Assets folder. If your theme has a "Custom CSS" section in the Theme Editor, that's often the safest place.
  4. Paste the following code at the bottom of the file (or in your Custom CSS section):
@media (max-width: 749px) {
.slideshow__media img {
object-fit: cover;
object-position: left center;
}
}
  1. Save your changes and check your site on a mobile device.

Remember to clear your browser cache if you don't see the changes immediately!

Solution 2: The Flexible Approach – Separate Sections for Desktop & Mobile

While PeppePro02's CSS fix is fantastic for adjusting image fitting, sometimes you need more control. This is where tim_1's advice from the community thread comes in handy. They suggested creating two entirely separate sections for your banner or slideshow: one designed specifically for desktop, and another optimized just for mobile. This gives you the ultimate flexibility to use different images, different text layouts, or even different aspect ratios for each device, ensuring a truly tailored experience.

Why This is Powerful:

  • Different Images: You can upload a landscape image for desktop and a portrait image for mobile, avoiding awkward cropping altogether.
  • Optimized Content: Maybe your desktop banner has a lot of text that becomes too small on mobile. With separate sections, you can simplify the mobile version.
  • Performance: You're only loading the relevant content for the user's device.

Step-by-Step Instructions:

This method involves using a bit of CSS to hide one section while showing the other, based on screen size.

  1. From your Shopify admin, go to Online Store > Themes.
  2. Click Customize to open the Theme Editor.
  3. On your homepage, click Add section.
  4. Add your desired slideshow or image banner section. Let's call this your Desktop Section. Configure it exactly how you want it to appear on desktop.
  5. Add another identical slideshow or image banner section. This will be your Mobile Section. Configure this one with images and content specifically optimized for mobile.
  6. Now, for the magic CSS:
    • Select your Desktop Section in the Theme Editor.
    • Look for a "Custom CSS" or "Custom Liquid" field within that section's settings (if your theme supports it). If not, you might need to edit the theme's code directly, similar to Solution 1, but targeting the specific section's ID or class.
    • Paste the following CSS into the Desktop Section's Custom CSS field:
@media (max-width:749px) {
  .section-id-or-class { display: none; }
}

Important Note: You'll need to replace .section-id-or-class with the actual CSS selector for that specific section. You can usually find this by inspecting the element in your browser's developer tools. If your theme provides a simple "Custom CSS" box for the section, it might automatically apply to the section itself, so you might just need { display: none; }. Tim_1's original guide suggests this works directly within a section's custom CSS block.

  1. Next, select your Mobile Section in the Theme Editor.
  2. Paste the following CSS into its Custom CSS field:
@media (min-width:750px) {
  .section-id-or-class { display: none; }
}

Again, replace .section-id-or-class with the correct selector for your mobile section.

  1. Save your theme. Now, when you view your site, the desktop section will hide on mobile screens (749px and below), and the mobile section will hide on desktop screens (750px and above).

Which Solution is Right for You?

Both of these methods are valid and effective, depending on your needs:

  • If your images are generally flexible and just need a little nudge to fit better on mobile without drastic changes, PeppePro02's CSS object-fit tweak is a quick win. It's less setup and works well for minor adjustments.
  • If you want completely different visual experiences, perhaps with unique images or content for each device, then tim_1's approach of using separate desktop and mobile sections offers unparalleled control. It requires a bit more initial setup but pays off in design precision.

Ultimately, the goal is to provide a seamless and visually appealing experience for all your customers, no matter how they're browsing your store. Experiment with these solutions, see what works best for your specific theme and images, and don't be afraid to tweak the object-position values or even the CSS breakpoints (749px/750px) to fine-tune things. A big shout-out to PeppePro02 and tim_1 for sharing their valuable insights with the community!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools