In this article we will learn about some of the frequently asked HTML programming questions in technical like “center a video horizontally” Code Answer’s. When creating scripts and web applications, error handling is an important part. If your code lacks error checking code, your program may look very unprofessional and you may be open to security risks. Error or stack handling on html was simple and easy. An error message with filename, line number and a message describing the error is sent to the browser. This tutorial contains some of the most common error checking methods in HTML. Below are some solution about “center a video horizontally” Code Answer’s.
center a video horizontally
xxxxxxxxxx
1
/*option 1:this makes the video responsive*/
2
.videoDiv
3
{
4
width: 70%; /*or whatever % you prefer*/
5
margin: 0 auto;
6
display: block;
7
}
8
9
/* option 2* does not make the video responsive*/
10
11
.videoDiv{
12
margin:0 auto;
13
display: block;
14
}
15
center a video horizontally
xxxxxxxxxx
1
<div class="videoDiv">
2
<video width="100%" controls>
3
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
4
<source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
5
Your browser does not support the video tag.
6
</video>
7
</div>