• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » CSS » How To Centering And Make Full Width Youtube Iframe On Blog Article

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

By Sigit Prasetya Nugroho ∙ May 11, 2017 ∙ CSS ∙ Leave a Comment

Share : TwitterFacebookTelegramWhatsapp

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.

Related Articles :

  • 4 Best Sites To Download School And Education Icons Sets
  • A Cool Collection Of CSS Gradient Border And How To Use Them
  • How to Make a Shake Effect Validation Like the WordPress Login Form

Table of Contents

  • 1 Putting a Youtube Embed Video In Center Position
  • 2 Installing Video Embed Youtube Full Width
    • 2.1 Above is a way to install embed video in center position and set the full width video on WordPress, hopefully this simple article useful.

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:

1
<div style="text-align: center;">Your youtube embed code</div>

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
<style>.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}</style>

Wrap the embed youtube code with the div element as follows

1
2
3
<div class="videoWrapper">
Your youtube embed code
</div>

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.

Another CSS Related Post :

  • Free Simple Admin Dashboard Bootstrap 4 By Seegatesite
  • 4 Best Sites To Download School And Education Icons Sets
  • How to Make a Shake Effect Validation Like the WordPress Login Form
  • [CSS] How To Fixed Select2 Responsive Width
  • Upgrade Responsive Bootstrap Table Using Footable Plugin
  • Change Bootstrap Modal Dialog Effect With Animate.css

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (7) Publisher Tips (5) react (3) Reactjs (7) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) widget (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2021 Seegatesite.com