The Hello Bar is a simple web toolbar that engages users and communicates a call to action.

How to Wrap Text Around A Video

In my blog post on How to Embed Video in a Blog Post, Scott asked in the comments if I could show how to get text to wrap around a video. If you want to learn how to embed video first, you should go check out that post.

It is totally possible to do this, but it requires a little HTML coding to make it work. When you paste the embed codes for a video into the WordPress write screen, you have be using the HTML tab, not the Visual tab.

When you want your post text to wrap around the video, place the video embed code inside of a DIV tag. The HTML DIV tag creates a box to contain the video. However, the “box” doesn’t have any style properties of its own, such as floating to the left so text wraps around it. You have give it those properties with CSS code.

CSS is Cascading Style Sheets. You can put a little CSS code right in the HTML DIV tag, as in the following code example:

<div style="float:left;margin:0 10px 5px 0;"><object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/HSZCk2EIQL0&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HSZCk2EIQL0&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object></div>

The highlighted parts are what you would have to type in around the pasted embed code. The code you see there is exactly the code that is making the video in this post float to the left so that the text wraps around it to the right.

I know that it’s certainly possible to do this with external stylesheets, but anyone who knows how to do that doesn’t need this help in the first place. :) I’m just trying to make something that’s normally hard for people a little easier. I’m not going to get into an argument with any code purists over this, so don’t bother.

Having said that, I also believe that if you’re going to be in the blogging game for a long time, it’s a good idea to learn this code stuff (especially if you have more time than money). Life will be easier.

In the video above, I talk about the book-only version of WordPress SEO Secrets, which I have created by popular request.

PS – Sometimes WordPress likes to change your HTML code for you when you switch from the HTML tab to the Visual tab. It doesn’t happen to me, but I noticed it happening on a client’s Mac running Firefox. You’ll know when it happens, because you don’t see your video! So if this happens to you, just don’t switch to the Visual tab when when you’re writing the post. Stay in the HTML tab.

PPS – You can use this same technique to “wrap” and float any block of code.

Did you enjoy this article?

Don't miss the next one! Get on the list. You'll also get my free report on the 10 Tragic Blogging Mistakes you may be making.

54 Responses to How to Wrap Text Around A Video
  1. Jessie
    March 30, 2009 | 11:45 am

    Thanks for the tip! I can use it for my wedding videos now!

  2. Blog Expert
    March 30, 2009 | 12:03 pm

    You should get some search engine traffic from this post.

  3. Patricia
    March 31, 2009 | 4:06 pm

    Thanks for the tip.I’ll try it

  4. Chris
    April 2, 2009 | 4:26 am

    I don’t mean to place urls in my response but for anyone using xhtml for their website before you go off and embed youtube video code into your site you need to go here http://www.tools4noobs.com/online_tools/ and use their tool to convert html youtube code into valid xhtml code. If you are using xhtml and you dont use this converter first you will never be able to validate your website at w3.org, which should be a big goal for every webmaster.

  5. Chris
    April 2, 2009 | 4:35 am

    P.S. You can modify the code generated by that site and eliminate their link that gets placed at the bottom of the video. You can do this by only coping the video link part of the code which should look like this

  6. Chris
    April 2, 2009 | 4:36 am

    P.P.S. I guess I cant place code in my comments. Sorry I tried to show an example.

  7. charlie
    May 8, 2009 | 6:39 am

    I used exactly the text you used in my HTML editor. I flicjed back to the visual version of the edititor and hey presto, you were right. Video left, text on the right. Saved it and the editor changed it all back, although the code still had the left align attributes to it.

    HEEEEEEEEEEEEEELLLLLLLLLLLLLLPPP

  8. Kate
    May 15, 2009 | 7:48 pm

    Thanks allot for this, didn’t even know you could do this.

  9. Kate
    May 15, 2009 | 7:51 pm

    o and btw WordPress sometimes posts html code if you just type normal text ( no code ). I just use normal html tag to make sure this does not happen. Once i posted a post with the visual tab and i didnt show up at all in IE. Then I just copied the text to html tab and everything worked fine.

  10. Joe
    May 27, 2009 | 8:54 am

    Thanks for this, just what I was looking for!

  11. Duke
    June 15, 2009 | 8:16 pm

    Thanks a lot mate…its been a great help….

  12. How to Wrap Text Around a Video
    June 17, 2009 | 4:02 pm

    [...] How to Wrap Text Around a Video [...]

  13. kathryn
    August 1, 2009 | 10:14 pm

    Hey thank you so much.. I have no idea what I am doing but I did exactly what you said and it worked like a charm! woohooo!

  14. Rose
    August 13, 2009 | 1:46 pm

    Thanks so much for your help! I’ve been looking for this coding for ages and you made it simple and easy! :D

  15. Mike
    August 14, 2009 | 2:26 am

    Thank you so much I was trying to figure that out and this made it work perfectly!

  16. Marco
    September 16, 2009 | 5:35 pm

    Works!!!
    Smart man

  17. Girl On the Brink
    September 27, 2009 | 11:32 am

    Hi, your instruction helped me enrich my website with video. Could you please write a post or tell me how to do rollover images in a WordPress blog? I couldn’t find a plug in so maybe there’s another way. I’m more of a script kitty (know it’s really spelled differently). Ann Powers

    • Michael Martine
      September 29, 2009 | 7:17 pm

      Ann, I’m not a script kiddie or kitty, either one. Looks like it’s just you and your buddy Google on this one. :)

  18. tom
    October 12, 2009 | 9:13 pm

    Thank you so much i looked for 3 days for this info once again thank u so much GREAT JOB

  19. intelliq
    October 20, 2009 | 12:16 am

    sorry, it didnt work with wordpress.org blog software that i host myself.

    ive been tinkering all night with no luck so far.

    • Michael Martine
      October 20, 2009 | 9:46 am

      If it’s not working, there are three probable causes:

      1: Your blog theme is interfering.
      2: You flipped back from the html tab to the visual tab, causing WordPress to “clean up” your code (i.e., ruin it). Stay in the html tab the whole time.
      3: Your code is wrong.

      • IntelliQ
        October 20, 2009 | 12:08 pm

        Thanks for your response. I checked all 3, to no avail. I was thinking too that maybe it was the theme, but Ive tried a few differrent themes that have no side columns to interfere with the code.

        I copied and pasted your exact code and stuck some text inside the DIV tags (but not inside the object tags).
        I also put text before and after the DIV tags.
        The results for all of it was the text shows below or above the video.

        I want to pull my hair out.
        (Hey is that what happened to you? LOL jk)

        I initially was using Firefox, but switched to IE. No diff.
        I stayed in the html tab the whole time since I read the other day that switching back to the visual one will ruin code.
        I have to say WordPress works well for the most part, very few flaws. This one really bothers me though, since Im working on meaty horror movie list with video and summaries of movies, and the text wrap around would be the perfect format for this.

        • Michael Martine
          October 20, 2009 | 12:18 pm

          In that case, consider getting a theme designed to work with especially with video. It will have built-in styles for you to take advantage of. You’ll work with your videos in a different way, probably by supplying the YouTube (or similar) page URL to a custom field.

  20. Gary Smith
    October 25, 2009 | 4:14 pm

    Good article. When I add the youtube code the WordPress TinyMCE won’t save my embed code? Stripes it out when saving?

    Ideas?

    • Michael Martine
      October 25, 2009 | 6:01 pm

      Gary, if you’re seeing the TinyMCE toolbar, you’re not using the HTML tab. You MUST use the HTML tab to do this. Reread the instructions in the post carefully, and you’ll see that’s what it says. :)

  21. Gary Smith
    October 25, 2009 | 6:09 pm

    I’ve used the editor on two other blogs I have. This is the only one that’s stripping out the enbed code? I’ve been using the HTML editor option. I’ve saved my work while in the HTML mode and in Standard mode. Upon page refresh the embed code disappears (as if I never entered it)?

    Is there a setting on the php file that should be enabled?

    gs

    • Michael Martine
      October 25, 2009 | 10:32 pm

      Gary, it could be plugin or your theme. Deactivating plugins and switching themes are how you would find out. Also make sure your blog and all plugins are upgraded to their latest versions.

      Also, you may have to remain in the HTML tab the entire time and not switch to visual at all.

  22. David Allred
    November 24, 2009 | 6:03 pm

    Thanks man. It's so simple when you really think about it. CSS is something I am getting better at. Thanks for the information once again!

  23. Kyle Junior
    November 25, 2009 | 8:46 pm

    That was awsome and easy!!! THANK YOU so much. Do you know how I can make that txt be centered to the right of that video too? That would be perfect.

  24. Kyle Junior
    November 25, 2009 | 9:52 pm

    Another question, regarding my previous one. I got the txt to wrap around the video using your div html codes. I need to put a group of videos in a column format, like under the “MORE FROM” box on youtube when you play a video. That's exactly what I need to do on my site. Videos, one on top of the other aligned to the left, w one or two lines of txt centered w the video, and aligned to the right of each video. Hope you can help. Thanks.

    • remarkablogger
      November 25, 2009 | 11:35 pm

      Kyle, if you look into learning about floated <divs> in CSS, you'll find out how to work out a situation like that. It starts to get a little complicated, but it's all based on the same properties used to float a single video like in this post. When these floated items are held inside a narrow-width container, they just each go row by row like a column.

      • Kyle Junior
        November 26, 2009 | 9:43 pm

        THANK YOU!!! I'll def. look into it.

  25. markfound
    November 30, 2009 | 6:22 pm

    many thanks – your advice gave me the answer I needed – much appreciated.

    • remarkablogger
      November 30, 2009 | 7:03 pm

      You're welcome! Glad it helped you. Please tell others about it, too. :-)

  26. Jason Clause
    December 11, 2009 | 2:04 pm

    Thank you for the help. It was very helpful!

  27. Lily
    December 11, 2009 | 9:10 pm

    Quick and dirty. Worked a charm – thanks, mate!

  28. tasra
    December 16, 2009 | 1:07 am

    I know you posted this over a year ago, but it's still a great tutorial and helped me get my site up and running with video wrap. Thanks so much!

    • remarkablogger
      December 16, 2009 | 1:37 am

      Thank you. That in itself is a great blogging lesson: over a year, and I
      still get comments of gratitude on this post every single week! I'm thrilled
      to be able to help you guys. :-)

  29. Martin
    December 28, 2009 | 3:44 pm

    Thanks man – just what i needed !

  30. michelle.
    January 1, 2010 | 6:56 pm

    I've been searching for this code for hours and hours and kept coming up with nothing. Everyone else's codes were either too complicated, didn't work, or a mixture of both. Haha.
    Thank you so much. Your rock:)

  31. Dr. J
    January 28, 2010 | 6:19 pm

    Thanks a million, This was super helpful

  32. Beau in Charlotte, NC
    January 31, 2010 | 3:32 pm

    Excellent! thank you for this! Being an HTML novice, I spent hours last night trying to figure out how to do this….once I found your solution I had it up an running in minutes. You're awesome!

  33. Keith Ellertson
    February 8, 2010 | 6:13 pm

    Sweet, You had what I was looking for my friend thanks

  34. Chris Leo
    February 16, 2010 | 10:08 pm

    Dude you are awesome, I was looking for this answer all over and you had it. Believe it or not I am internet expert and still a relative newbie on WordPress, so thank you.

    Check out the sites talksportsPhilly.com and talksportsUSA.com, i'd like your opinion.

    • remarkablogger
      February 16, 2010 | 10:30 pm

      You are welcome, glad it was helpful! Giving my opinion on blogs (and
      recommendations) is what people pay me
      for<http://remarkablogger.com/blog-consulting>.
      :-)

      • Chris Leo
        February 17, 2010 | 6:56 am

        Um no offense, But fortune 500 companies come to me for answers most of the time, so if you are that stuck up, don't bother, LOL

        • remarkablogger
          February 17, 2010 | 1:13 pm

          Sorry you feel you have to interpret my separation of free content vs. paid
          services as being “stuck up.”

  35. remarkablogger
    February 16, 2010 | 10:30 pm

    You are welcome, glad it was helpful! Giving my opinion on blogs (and
    recommendations) is what people pay me
    for<http://remarkablogger.com/blog-consulting>.
    :-)

  36. Goy Gevalt
    February 17, 2010 | 10:21 pm

    Thanks for posting this! I updated all of my blog posts with videos in them.

    • remarkablogger
      February 17, 2010 | 10:35 pm

      Awesome, glad you found this information helpful. :-)

  37. Frank
    March 14, 2010 | 8:39 am

    Does not work in Internet Explorer 64-bit.

  38. Frank
    March 14, 2010 | 1:39 pm

    Does not work in Internet Explorer 64-bit.

  39. [...] of playing around with obvious methods seems to satisfy your requirements. However, thanks to remarkableblogger the solution is super easy. (It just takes persistence using the search engines, yes your answer is [...]

Remarkablogger is powered by Headway

Get Headway Themes

The Headway WordPress theme framework gives you total control over the appearance of your WordPress site without writing any code.

  • Create a color scheme "automatically" based on your header image colors with Headway's Quick Start Wizard
  • Headway's Visual Editor lets you build your site live and watch it happen
  • Everything managed easily via drag & drop
  • Use, create & save your own style sets and templates to easily change the look of your site without code
  • Social media integration and search engine optimization built-in
  • Friendly Headway user community with active forums and outstanding support
  • "Plain English" documentation (including lots of screenshots and videos)
  • Automatic updates
  • 100% GPL-compliant

Headway lets you design your site your way. It's about control, not code.

Check out Headway now to see the full list of features and showcase gallery.