Shopify themes, liquid, logos, and UX
can anyone tell me how to center a video I have on my site with custom css. it is currently aligning to the left of the screen.
Also, is there a way to load it muted?
<video controls="controls" style="max-width: 100%; height: auto;">
<source src="my url" type="video/mp4" />
Your browser does not support our video.
</video>
Solved! Go to the solution
This is an accepted solution.
the muted code worked, thank you!
but how would you integrate this code?
.container-div { text-align: center; } video{ margin: 0 auto; }
into this?
<video controls="controls" style="max-width: 100%; height: auto;">
<source src="my url" type="video/mp4" />
Your browser does not support our video.
</video>
Hi, @Kari_M
You need to change the css of the container div.
.container-div {
text-align: center;
}
video{
margin: 0 auto;
}
For loading it muted, you should add the muted attribute for the video, like this.
<video controls="controls" muted style="max-width: 100%; height: auto;">
<source src="my url" type="video/mp4" />
Your browser does not support our video.
</video>
Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!
This is an accepted solution.
the muted code worked, thank you!
but how would you integrate this code?
.container-div { text-align: center; } video{ margin: 0 auto; }
into this?
<video controls="controls" style="max-width: 100%; height: auto;">
<source src="my url" type="video/mp4" />
Your browser does not support our video.
</video>
Can you share your store url?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025