How To Centering And Make Full Width Youtube Iframe On Blog Article

Adding content youtube into post articles often make us hassle to show the youtube video at the center position. By adding youtube content into articles can improve your website SEO ranking. But often the youtube iframe can’t appear in the right position so the embed video display becomes unattractive. Maybe you are a new blogger and do not understand about CSS feel frustrated when you want to put the video on your WordPress site.

The look of the standard embedded youtube video in WordPress article like the following picture:

How To Centering And Make Full Width Youtube Iframe On Blog Article

The image above shows that the youtube video I embed are not in the middle position and looks unattractive layout. I will share a short trick to help you in setting the video embed position to be in the middle of your article content.

Putting a Youtube Embed Video In Center Position

After getting the youtube embed code, add the div element to wrap the youtube iframe code like this:

And the result of the installation of the above code makes the video in the right position now, that is in the middle. You can’t center the video by clicking the “align center” format button on the WordPress “visual editor” tab but still have to add the div element code using the manual on the “text editor” tab. And the results become as shown below.

Thus you have successfully created a video embed youtube right in the middle position

Installing Video Embed Youtube Full Width

To install video embed youtube for the full width you need to add a little CSS to set youtube iframe. This trick I get directly from the site css-tricks.com. Here’s how:

You should add this CSS code via the “Text editor” tab. Then add the following CSS code:

Wrap the embed youtube code with the div element as follows

Here the result:

In addition to the above, there is an easier manual way: by choosing the custom width and height iframe on the youtube option menu like the following image:

Make Full Width Youtube Iframe Video On Blog Article WordPress

If you want to add an entire youtube video to your old article, you can add a jquery script to execute a youtube embed video on every article. You can read the tips here https://css-tricks.com/fluid-width-youtube-videos/

Above is a way to install embed video in center position and set the full width video on WordPress, hopefully this simple article useful.

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.