[Resolved] How to "float a YouTube" embed video into a post?

Home Forums Support How to "float a YouTube" embed video into a post?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1176191
    Henry

    Thanks for helping.

    OK, I’d like to “float” a YouTube embedded video into a generic vanilla GeneratePress Post.

    I know that I just need to paste in the iframe but that makes the image full width.

    Is there a way to maximise the width of the video so that on desktop view it doesn’t stretch the entire width of the page which can look a bit ugly.

    Perhaps I am overcomplicating this – not sure, but I thought I’d ask anyway.

    Thanks!

    #1176617
    Leo
    Staff
    Customer Support

    Hi there,

    Have you tried the YouTube embed blocks?

    Then you can use the alignment options:
    https://www.screencast.com/t/OzOfcYei4L2j

    #1176902
    Henry

    Thanks Leo, in fact we had to disable Gutenberg b/c of some customization.

    I fixed it like this:

    <div style="text-align:center">
    <iframe width="560" height="315" src="https://www.youtube.com/embed/jmXJNyXq1yU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </div>

    Do you think that’s a good approach?

    T

    #1176903
    Leo
    Staff
    Customer Support

    Nothing wrong with that if works for you 🙂

    #1176915
    Henry

    Thanks!

    #1176988
    Leo
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.