-1

I tried things like text align and center tags... Can anyone help?

Thanks - Max

Max
  • 3
  • 1
  • 3
  • Possible duplicate of [How can I align YouTube embedded video in the center in bootstrap](https://stackoverflow.com/questions/22433616/how-can-i-align-youtube-embedded-video-in-the-center-in-bootstrap) – T.Todua Aug 08 '17 at 18:23

2 Answers2

1

You shouldn't use the center tag. Leave all the styling to the CSS.

Did you try setting the left and right margins to auto?

Something like:

margin: 0 auto;

Edit: I was able to center a YouTube video by making the CSS for the iFrame set its width, set its display type to block, and set the horizontal margins to auto. Here's what my code looks like.

iframe {
    width: 560px;
    display: block;
    margin: 0 auto;
}
1

Add the following CSS property to your iframe and:

Demo on Fiddle

iframe {
    display: block;
    margin: auto;
}
Weafs.py
  • 22,731
  • 9
  • 56
  • 78
  • This did not work for me. I put that in my index.html and I put your code in my main.css class. – Max Oct 18 '14 at 20:18