Shopify Images Disappearing? The Hidden Culprit: Non-Breaking Spaces ( )
Ever run into one of those head-scratching Shopify bugs that just makes you want to pull your hair out? You know the kind – everything seems fine, your settings are correct, but something crucial just isn't showing up as it should. Recently, we saw a classic example of this in the Shopify community forums, and the solution was so unexpected, it's definitely worth sharing.
Our fellow store owner, chaserchim, posted a perplexing issue: product images were completely disappearing on certain product pages, but only on desktop screens. If the browser window was smaller, like on a mobile device or a half-screen desktop, everything looked perfect. The kicker? It was happening across all themes they tried, and they'd already checked the usual suspects like image assignments and cache.
The Initial Detective Work: A Collapsing Column
When you're dealing with layout issues, especially ones that change with screen size, it's often a CSS problem. Another community member, Ros222, quickly honed in on this. Their initial assessment was spot on: the images were actually loading, but the desktop product media column was somehow collapsing to 0 pixels wide. This is why it looked fine on smaller screens – the layout rules for those sizes were different, or the long-word issue wasn't triggered.
Ros222 suggested checking custom CSS around elements like .product-information__media, media-gallery, or anything touching grid column widths. They also wisely pointed out that since it was happening across themes, an app or custom code injecting global CSS could be a culprit. Great starting points for any developer or savvy store owner with a knack for the code editor!
The Unexpected Culprit: Non-Breaking Spaces ( )
But then, tim_tairli dropped the real bombshell. This wasn't just a generic CSS issue; it was a deeply specific, almost unheard-of interaction between product content and how browsers render CSS Grid layouts. The problem products all had one thing in common: an "Ingredients" section in their descriptions that had been copy-pasted from somewhere else.
The crucial detail? This copy-pasted text contained non-breaking spaces, represented in HTML as . While they look like normal spaces, they tell the browser: "Hey, don't break this line here!" In this particular case, it effectively turned the entire "Ingredients" content into one single, incredibly long 'word'.
Take a look at how those sneaky symbols appear in the HTML:

The CSS Grid Glitch
This "super-long word" then collided with a known bug in how CSS Grid layouts handle text wrapping, specifically that it "doesn't support word-wrap, overflow-wrap and hyphens properties" during its initial width calculations. What happens is, the browser calculates the width of the product info wrapper assuming this 'word' is one continuous, unbroken string. Then, it applies the rule that *does* wrap the long word, but by then, the layout has already been messed up, causing the image column to shrink to nothing.
How to Fix Disappearing Product Images
Thankfully, tim_tairli provided several actionable solutions. You've got options depending on how hands-on you want to get!
Option 1: The Clean-Up (Recommended for Long-Term Health)
This is arguably the best long-term solution, as it addresses the root cause directly in your content. If you don't have a huge number of affected products, this is quite manageable.
- Go to your Shopify admin and navigate to Products.
- Find the products where images are disappearing.
- In the Description field, look for any sections you might have copy-pasted, especially "Ingredients" lists or similar detailed text.
- Switch the description editor to HTML view (click the
<>icon in the toolbar). - Carefully scan the HTML for
. - Replace all instances of
with a regular space (just hit the spacebar). - Save your product.
Doing this not only fixes the layout but can also be beneficial for SEO, as search engines prefer clean, well-formatted content.
Option 2: The Quick CSS Patch (Easiest Code Fix)
If you have many products or prefer a code-based solution that applies globally, this CSS snippet is a fantastic quick fix.
- From your Shopify admin, go to Online Store > Themes.
- Find your current theme, click Actions > Edit code.
- In the Theme editor, click on Theme settings (the cog icon in the bottom left).
- Scroll down to Custom CSS.
- Paste the following code into the Custom CSS box:
/* prevent stretching of grid parents if very long words
https://github.com/rachelandrew/gridbugs/issues/46
*/
.text-block.rte * {
word-break: break-word;
}
- Save your changes.
This code tells the browser to break words within your rich text editor content, preventing them from creating excessively long, unbroken strings that mess with the grid layout.
Here's a visual of the before and after:


Option 3: The Targeted CSS Tweak (If Option 2 has side effects)
While the previous CSS snippet is usually safe, if you find it negatively affects other words on your site, there's a more targeted approach that adjusts the grid columns specifically:
/* prevent stretching of grid parents if very long words
https://github.com/rachelandrew/gridbugs/issues/46
*/
@media screen and (min-width: 1200px) {
.product-information__grid:not(
.product-information__grid--half,
.product-information--media-none
).product-information--media-left {
grid-template-columns: 2fr minmax(0,1fr);
}
.product-information__grid:not(
.product-information__grid--half,
.product-information--media-none
).product-information--media-right {
grid-template-columns: minmax(0,1fr) 2fr;
}
}
This code should also be pasted into your theme's Custom CSS section, just like Option 2. It specifically targets the product information grid for larger screens (min-width: 1200px) and adjusts how its columns are sized, preventing the image column from collapsing.
Preventing Future Headaches
The biggest takeaway here is to be mindful when copy-pasting content from external sources (like Word documents, PDFs, or other websites) directly into your Shopify product descriptions or pages. These sources often carry hidden formatting, including non-breaking spaces or other invisible characters, that can wreak havoc on your site's layout.
A good practice is to paste content into a plain text editor first (like Notepad on Windows or TextEdit in plain text mode on Mac) to strip out all formatting, then copy it from there into Shopify. Or, use Shopify's rich text editor and manually format the text.
It's these kinds of obscure bugs that highlight the power of the Shopify community. What started as a baffling problem for one store owner quickly became a learning opportunity for many, thanks to the collaborative spirit and expertise shared on the forums. If you're using a specific theme (like Horizon, mentioned in the original thread), consider leaving a review with a link to this solution so theme developers can bake these fixes into future updates. It's how we all help make the Shopify ecosystem stronger!