0

I am trying to center the YouTube video but am having trouble. Here is the code.

 <div class="video">
<iframe width="560" height="315" align="middle" padding-bottom=0px left=40px src="https://www.youtube.com/embed/lHv3i9-2a0s" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
      </div>

You can find the files (html and css) at the repository below. https://github.com/t0091/bootstrap/tree/master/home

1 Answers1

1

You can set iframe as

iframe{
  margin:0 auto;
  display:block;
}

iframe{
  margin:0 auto;
  display:block;
}
<div class="video">
<iframe width="560" height="315"  align="middle" padding-bottom=0px left=40px src="https://www.youtube.com/embed/lHv3i9-2a0s" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
      </div>
Hien Nguyen
  • 24,551
  • 7
  • 52
  • 62