I am trying to center the embedded YouTube video on the page of the boot page. The video size is always the same.
My HTML looks very simple:
<div class="video"> <iframe width="560" height="315" src="https://www.youtube.com/embed/ig3qHRVZRvM" frameborder="0" allowfullscreen=""></iframe> </div>
I tried different solutions from stackoverflow (which concerned only the centering of the div, not the video), and the best I could come up with was this fiddle .
I have already tried solution1 , solution2 , solution3 , but to no avail. Another partially successful solution was to use:
width: 50%; margin: 0 auto;
It worked well on a desktop computer, but did not work on an iPad or phone (the video partially went off the screen). How to center the video on the desktop / tablet / phone?
css youtube twitter-bootstrap
Salvador dali
source share