A Shopify store owner implemented custom CSS to display a homepage video that resizes on mobile devices. The video successfully resized to 300% width on screens under 767px, but became left-aligned instead of centered.
The Problem:
Video displayed at 300% width on mobile (intentional for better screen coverage)
Lost center alignment, appearing justified to the left
Horizontal scrolling became possible, showing extra video content
The Solution:
A helper provided CSS code targeting the specific video container class:
Added display: flex; and justify-content: center; to center the oversized video
Added overflow: hidden; to prevent horizontal scrolling
Code placed in theme’s base.css or main.css file within a media query for screens min-width 767px
Resolution: Issue successfully resolved. The video now displays centered on mobile while maintaining the desired 300% width, with no unwanted scrolling.
Summarized with AI on November 12.
AI used: claude-sonnet-4-5-20250929.