Site logo

[Resolved] How to change youtube video size

Home Forums Support [Resolved] How to change youtube video size

Home Forums Support How to change youtube video size

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1530754
    Margot

    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.

    #1530929
    David
    Staff
    Customer Support

    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.

    #1531296
    Margot

    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,

    #1531473
    Tom
    Lead Developer
    Lead Developer

    Adding it at the end should work:

    wp-embed-aspect-4-3 wp-has-aspect-ratio contain-video

    #1533162
    Margot

    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

    #1533215
    David
    Staff
    Customer Support

    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.

    #1533247
    Margot

    Finally, this way works ! Thank you very much ! Have a nice day.

    #1533252
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.