How To add Youtube Video In Center In WordPress Post

December 31, 2017

Add Youtube Video Center WordPress Post

Youtube video is most popular free streaming video sites in online. Its very helpful for the blog reader  to watch youtube video with wordpress post. But we know that adding youtube video is displaying left hand side on the post which sometimes its very odd to see, or sometimes you don’t like to set it in left side of the post . So what is the best way to add youtube video in center of wordpress post ?

 

Add Youtube Video  Center  WordPress Post

Add Youtube Video Center WordPress Post

src=”https://www.prioarena.com/wp-content/uploads/2017/12/Screen-Shot-2014-08-21-at-13.55.33-e1408625802797-300×175.png” alt=”How To Center Align A YouTube Video Embed In WordPress” width=”300″ height=”175″ />

In this short tips you will know this, in generally youtube video embed code has iframe code you have to wrapped the code with div tag where you like to show the video in your post in center. The code is given below:

How To add Youtube Video In Center In WordPress Post

<div style=”text-align: center;”> XXX </div>

You have to add the youtube embed code at the xxx

If you are not able to set youtube video at the center of the post after following above code just try this code below:

<center> video embed code </center>

The most common way to embed youtube video is adding center with greater and lesser than bracket I hope you can set your youtube video easily in center of the post in wordpress.

Here i have given example of two methods :

First code using given by div tag :

<div style=”text-align: center;”> <iframe width=”480″ height=”360″ src=”//www.youtube.com/embed/QiLXx-0W8Q4?rel=0″ frameborder=”0″ allowfullscreen>

</div>

Second and most common using code example:

<center> <iframe width=”480″ height=”360″ src=”//www.youtube.com/embed/QiLXx-0W8Q4?rel=0″ frameborder=”0″ allowfullscreen></center>

Here  lets look at a Youtube video with center align Example of the wordpress post

<iframe src=”https://www.youtube.com/embed/QiLXx-0W8Q4″ width=”560″ height=”315″ frameborder=”0″ allowfullscreen=”allowfullscreen“></iframe>
WordPress for some securtiy reason doesn’t allowed iframe code directly so that’s why sometimes we face bit difficulty to embed youtube video code with wordpress post using iframe.

 

I hope following above example you will be able to add   center youtube video in center align of the post correctly. In general you tube default video width code is 560 if you don’t want to show you tube video in full screen you can set it 360 or more with your choices.

 

 

(Visited 16 times, 1 visits today)
Please follow and like us:
0

Leave a Comment:

All fields with “*” are required

Leave a Comment:

All fields with “*” are required

Top Optimized with PageSpeed Ninja

Enjoy this blog? Please spread the word :)