Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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?