Insert videos from YouTube and other services is very simple in WordPress you just have to copy the URL and they are activated automatically, they become in its player, the problem that I want to deal with today is that they occupy the whole width of the content, and sometimes we would like it to be integrated, with the text floating around just as we can do with the images.  And I'm not talking about videos always being aligned right or left with the text around, that would be easy with a bit of CSS, but decide on a specific entry if a video is on the right or left, with the text floating around .
Well, the solution is not to use the oEmbed feature that allows you to show the player just by copying and pasting the URL of the video, but using the code or iframe that we also usually offer these services and that at least YouTube does offer.
To do this, for example on YouTube, click on " Share "
Instead of sharing now, click on the link" Insert ":
What you get open a window where we already have the code iframe to insert :
In your WordPress editor switch to the HTML tab and paste where you want the code to appear iframe .
The code will look something like this:
< iframe width = " 560 " height = " 315 " src = " https://www.youtube.com/ embed / iMm3-kjGXRw " frameborder  = "0" allow = "autoplay; encrypted-media " allowfullscreen > < / iframe >
Well, the trick is to modify that code iframe The first thing is to remove the width and height parameters ( widht and height ), then we will add the following:
style = " width: 50%; float: right; "
With what the code would look like this:
< iframe src = " https://www.youtube.com/embed/ iMm3-kjGXRw " frameborder = " 0 " allow = " autoplay; encrypted-media " allowfullscreen style = " width: 50%; float: right; "> < / iframe >
If you notice, we have indicated that the width occupies only 50% of the available block and, this time , we have indicated that the video is placed on the right ( float: right ) of the content.
Do you want it to be on the left, because it just changes right by ] Do you want the video a bit bigger or smaller? Change the width percentage.
What we got is exactly what you are seeing here on the right, which the video is to the right of the text, and it surrounds it by its left .
It is the same as we could do with an image, defining its alignment with respect to the text, but in this case a tad more complicated, modifying these parameters in the same code.
And that's it, that you align it well, I hope you liked the trick ito.