Horizon Theme Horizontal Scrollbar Woes? Here's How to Fix It (Page-Specific!)

Hey there, fellow Shopify store owners! Ever logged into your site, taken a quick scroll, and suddenly found an annoying horizontal scrollbar messing up your perfectly designed page? It’s a common frustration, and one that recently popped up in the community with an "urgent" plea from TCC_2025 regarding their Horizon theme. They specifically wanted to fix this on just one page: their custom bags manufacturer page, without affecting the rest of their beautiful store.

This is a classic web development head-scratcher, and the community really rallied with some fantastic insights and solutions. Let's dive into why this happens and, more importantly, how you can banish that pesky sideways scrollbar for good!

Understanding the Pesky Horizontal Scrollbar

When you see a horizontal scrollbar, it almost always means there's an element on your page that's wider than the available screen space. As Josh-FiveAcreCode pointed out in the thread, often this happens when you have a component designed to be "full bleed" (edge-to-edge) using width: 100vw (100% of the viewport width). The problem? Your browser's vertical scrollbar actually takes up a few pixels of that 100vw space, causing the content to subtly overflow and trigger the horizontal scroll.

It could also be a section with a fixed pixel width that's too large for smaller screens, or perhaps an embedded element that isn't resizing correctly. Whatever the cause, it breaks the smooth user experience we all strive for.

Finding the Culprit (The Expert Way)

Before just hiding the scrollbar, it's always a good idea to understand what's actually causing it. As adwaizer brilliantly suggested, you can use your browser's developer console to pinpoint the offending element. This is a bit more technical, but incredibly powerful:

  1. Open the page on your store that has the horizontal scrollbar.
  2. Right-click anywhere on the page and select Inspect (or Inspect Element). This opens your browser's developer console.
  3. Go to the Console tab.
  4. Paste the following JavaScript code and press Enter:
[...document.querySelectorAll('body *')].filter(el => el.getBoundingClientRect().right > document.documentElement.clientWidth + 1).map(el => el.tagName + '.' + [...el.classList].join('.'))

The output will show you the tagName and classList of elements that are extending beyond the right edge of your viewport. This can often lead you directly to the section or block that needs its width adjusted (e.g., setting max-width: 100% on it).

The Quick & Page-Specific Fix: Using Custom Liquid

For TCC_2025, the goal was to fix this on a specific page only, and this is where the community really shined. Both Ploqo and adwaizer offered a fantastic, page-specific solution using a Custom Liquid section. This method is elegant because it keeps the CSS contained to just the page template where you apply it, leaving the rest of your store untouched.

Here’s how to do it, based on Ploqo's clear steps, with a slight tweak from adwaizer's recommendation for overflow-x: clip which is generally safer for sticky headers than hidden:

  1. Go to your Shopify Admin, then navigate to Online Store > Themes.
  2. Find your current Horizon theme and click Customize (or Edit theme).
  3. At the top, click on the dropdown menu (usually says "Home page") and select Pages, then choose the specific page you want to fix (e.g., "Custom Bags Manufacturer").
  4. In the left sidebar, scroll down and click Add section.
  5. From the list of sections, choose Custom Liquid.
  6. In the Liquid box that appears, paste this code:

While Ploqo's original code included a specific class [class*="ai-carousel-container"] which might be useful if you know that's the exact element causing the issue, the broader html, body { overflow-x: clip; } is a solid, general fix for the entire page's overflow. Remember to click Save!

You can see the "Before" and "After" of Ploqo's test, which shows just how effective this simple CSS snippet can be:

Before

After the fix given below

A Note on overflow-x: clip vs. overflow-x: hidden

You might see both clip and hidden used for overflow-x. As adwaizer wisely noted, clip is generally safer for html, body elements because it prevents content from being scrolled (clipped) but doesn't create a new scrolling context or interfere with sticky elements like headers. hidden can sometimes inadvertently break sticky positioning, so clip is the preferred choice here.

Other Approaches & Considerations

While the Custom Liquid section is great for page-specific fixes, other solutions were discussed:

  • Global CSS (Less Ideal for Page-Specific): devcoders suggested adding CSS to Asset > base.css. While this works, it applies the fix site-wide. If you only want to affect one page, this isn't the best approach. Plus, the class name image-carousel-ashzzc21vuzzrngrtocustomcardcarosueldkvwlx.ai-carousel-container-ashzzc21vuzzrngrtocustomcardcarosueldkvwlx looks very specific to a particular app or setup, making it less generic.
  • Targeting the Culprit Element Directly: Josh-FiveAcreCode also mentioned that if you're okay with a component being framed (not full-bleed), you could set its CSS to width: 100%; instead of 100vw and remove any problematic margin-left with calc(-50vw + 50%). This is a more surgical fix if you can identify the exact element causing the overflow.

The beauty of the Shopify community is how different experts offer various angles to tackle a problem. For store owners who are looking to create their own online presence or refine an existing one, understanding these little CSS nuances can make a big difference in how professional and polished your site feels. If you're just starting out and exploring platforms, consider Shopify for its robust ecosystem and helpful community that can guide you through these kinds of challenges.

Ultimately, a smooth, no-surprises browsing experience is key for your customers. By applying these community-tested fixes, you can ensure your Horizon theme pages look crisp and clean, from edge to edge, just as you intended. Happy customizing!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases