0
How do you align a video to the center in HTML?
Im trying to make a webpage, but i cant get the darn video to be aligned to the center, why cant it? i know css, so i can use that as well if needed.
5 Answers
+ 1
It depends.
Go ahead and post a link to your Code Playground project so we can take a look under the hood.
+ 1
You need to put iframe in container, like this:
<div class="centered">
<iframe ... ></iframe>
</div>
and then set container' width to fixed and side margins to auto like this:
.centered {
width: 350px;
margin-left: auto;
margin-right: auto;
}
+ 1
How big did you want it?
iframe {width:100%;}
or
video {width:100%;}
should at least make it not bleed out (overflow) horizontally.
0
https://code.sololearn.com/WZ71hYEitf8z/?ref=app
if you open it with your pc, then you'll see how it actually looks like
0
hello, thank you for your help, but it doesn't seem to be working