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?
A user needs help centering a video element on their site and making it load muted by default.
Solutions Provided:
muted attribute directly to the <video> tag (confirmed working by original poster)text-align: center; on the containermargin: 0 auto; on the video elementCurrent Status:
The muting solution has been successfully implemented. However, the user is unclear about how to integrate the centering CSS with their existing inline video code. The helper has requested the store URL to provide more specific guidance on implementing the centering solution.
Outstanding Issue:
The discussion remains open as the centering implementation needs clarification—specifically how to apply the container div CSS to the existing HTML structure.
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?
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.
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as 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?
Can you share your store url?