Archived topic
Setting a default aspect ratio for all YouTube embeds
1 reply · Started by Dmitrii on July 17, 2022
Not sure if this is the right place to post, but I'm having trouble finding a solution to this.
I'd like to standardize the aspect ratio of my YouTube embeds so that there's consistency across each post (having multiple videos on the same post with different aspect ratios does not look great).
The aspect ratio that I want is "wp-embed-aspect-4-3 wp-has-aspect-ratio"
I've been doing this manually by changing the "Additional CSS Classes", but wondering if there's a more automated way?
Thanks!
Hi Dmitrii,
Personally, I do it that way too. But if you want to override the class maybe you could try adding this CSS in Appearance > Customize > Additional CSS:
.wp-embed-responsive .wp-block-embed-youtube .wp-block-embed__wrapper::before {
padding-top: 75%;
}
It might be good to ask for suggestions in our GP Community as well: https://www.facebook.com/groups/1113359788719597
Hope this helps!