Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i center Youtube Video (iframe) in twitter bootstrap 3?

Hi I am trying to center the iframe for a Youtube video in Twitter Boostrap 3, currently it is left aligned.

I have used the following html:

      <div class="embed-responsive embed-responsive-16by9">

      <iframe class="embed-responsive-item"  
       src="http://www.youtube.com/embed/zpOULjyy-n8?rel=0" 
       align="center" id="videothumbnail"></iframe>

       </div>

CSS:

    #videothumbnail{
    height: 50%;
    width: 50%;
    float: center;}
like image 248
user3931756 Avatar asked Aug 29 '14 02:08

user3931756


Video Answer


1 Answers

Use classes col-xs-12 text-center. You don't need float:center;

So change this:

<div class="embed-responsive embed-responsive-16by9">

to

<div class="embed-responsive embed-responsive-16by9 col-xs-12 text-center">
like image 93
Dan Avatar answered Oct 04 '22 03:10

Dan