Archived topic
How to "float a YouTube" embed video into a post?
5 replies · Started by Henry on February 25, 2020
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!
Hi there,
Have you tried the YouTube embed blocks?
Then you can use the alignment options:
https://www.screencast.com/t/OzOfcYei4L2j
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
Nothing wrong with that if works for you :)
Thanks!
No problem :)