Archived topic
How to change youtube video size
7 replies · Started by Margot on November 14, 2020
Hello there,
I would like your help about changing a youtube video size. I inserted a youtube video in my page "Qui sommes-nous?" and I think the video is too big. I do not know how to change it, i do not find the way in settings.. Could you help ma please ?
Thank you very much.
Hi there,
The YouTube Video Embed Block doesn't have any controls it automatically displays the video at the original aspect ratio and fills the space available to it. You can make it smaller by doing this:
1. Select the Video Block, go to Settings > Advanced -> Additional CSS Class(es) and add: contain-video
2. Publish those changes.
3. Add this CSS to your site:
.contain-video {
max-width: 360px;
}
Change the 360px to the max-size you require.
Thank you for your reply. I tried this but it does not work...
In the Video Block, Settings > Advanced -> Additional CSS Class(es), this is written : wp-embed-aspect-4-3 wp-has-aspect-ratio. Maybe I can not add "contain-video" to this ? I tried at the end with a space but I do not know if it was the good way..
Thank you,
Adding it at the end should work:
wp-embed-aspect-4-3 wp-has-aspect-ratio contain-video
Hello again,
Thank you for your help but I tried again and it does not work... I do not kow why but I even tried with .contain-video {
max-width: 50px;
}
In order to see if there was a size difference (after changing CSS's video block with wp-embed-aspect-4-3 wp-has-aspect-ratio contain-video) and the video size is always the same...
Do you have any idea about this ?
Thank you very much
Can you remove the CSS and add it to the very top of the Customizer CSS code - so it appears before all the other code.
Finally, this way works ! Thank you very much ! Have a nice day.
Glad to hear that!