Andrii Gorokhovskyi
Andrii Gorokhovskyi

Reputation: 35

How do I change youtube embed video player size in Wordpress?

I want to adjust size of embed youtube video in Wordpress, but it goes full width (Wordpress blog page). I want e.g. 60% of page. How do I change it?

Upvotes: 1

Views: 8860

Answers (5)

IamNatangwe
IamNatangwe

Reputation: 15

Code below works better.

iframe {
    width: 896px !important;
    height: 504px !important;
}

Upvotes: 0

Della Heywood
Della Heywood

Reputation: 21

This worked best for me:

iframe {
    max-width:  50% !important;
    max-height: 50% !important;
}

No black framing pillars or weird sizing.

Upvotes: 2

ABC Taylor
ABC Taylor

Reputation: 70

Try this (tested):

iframe { width: 40% !important; height: 40% !important; }

This will affect all iframe elements on your website. Add the above CSS in the theme customiser on WordPress.

Upvotes: 0

Eric Pinheiro
Eric Pinheiro

Reputation: 11

You need to change the css style of your theme.
My suggestion:
1)inspect the page of blog and discover what tag the video is child.
2) Go to the de css style page and put the follow code with the tag of your blog:

#blog-id .iframe {
    width: 60%!important; 
}

Upvotes: 0

Abhishek singh
Abhishek singh

Reputation: 16

if you are using a plugin then it must have some kind of dimension options there. But if you are not using any plugin then use might have to use custom css. But you might not able to use iframe within wordpress as it allows only http not https inside i frame.

Upvotes: -1

Related Questions