Wrap Text Around A Video in WordPress

To wrap text around a youtube (or other) video in WordPress, switch to the HTML view:

Paste in this code before the video embed code:

 <div style="float:left;margin:0 10px 5px 0;">

(click here to see the youtube embed code)

Paste in this code after the video embed code:

 </div>

You will get these results:

 

 

This is an example of wrapping text around a youtube video. First find the video on youtube, then start your blog post. Then copy this code  <div style="float:left;margin:0 10px 5px 0;"> and paste it into your blog post while in HTML view. Then get the youtube embed code and paste it in next. Follow that with the code </div>. You can tweek the code if you want it to float on the right or left and the padding around by changing the code.

About these ads

6 Comments (+add yours?)

  1. Anonymous
    Mar 12, 2012 @ 06:36:31

    THANK YOU!!!
    Have been trying to figure this out

    Reply

  2. Kevin Ashcroft
    Jun 12, 2012 @ 15:17:12

    Really useful thanks for the information, it worked 1st time.

    Reply

  3. Jim Camenga
    Jul 17, 2012 @ 02:20:31

    Great stuff. Thanks

    Reply

  4. lia
    Aug 09, 2012 @ 15:24:00

    THANK YOU!!!!

    Reply

  5. Anonymous
    Aug 11, 2012 @ 14:23:57

    i searched all over the web for the answer to this n u were the only one that had the correct info and posted it. direct short simple to the point.
    THANK U!!

    Reply

  6. Keith Dorwick
    May 20, 2013 @ 07:00:05

    You could also just create a new class for the video tag in css. That would mean you’d just add class=”wrap” to your video tag in your code:

    video.wrap {

    float:left;margin:0 10px 5px 0;
    border:2px solid gray;

    }

    Put that in a css style sheet and that would create a nice wraparound effect without adding all over the place.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: