A Shopify user needed help centering a homepage video element that was aligning to the left instead of center.
Original Issue:
User had basic HTML/CSS code for an autoplay video but lacked proper alignment styling
The video appeared left-aligned when loaded on the homepage
Solution Provided:
Another user (ZestardTech) shared CSS code that:
Uses display: flex with justify-content: center and align-items: center on the container
Sets the video to width: 100% and height: 100vh for full viewport coverage
Includes max-width: 100% to prevent overflow issues
Outcome:
The solution worked perfectly for the original poster, who confirmed success and thanked the helper. The issue was resolved with the provided flexbox-based centering approach.
Summarized with AI on November 8.
AI used: claude-sonnet-4-5-20250929.
I’m very new to coding and have managed to find code to add a video to my homepage, however, I’m unsure what needs to be added to ensure it appears aligned in the centre of the screen, rather than the left once loaded. This is what I’ve got so far:
Thank you for your response. It’s good to know that it’s worked for you. Kindly feel free to get back to me if you need any further assistance.
If helpful then please Like and Accept Solution.