1. Home
  2. Computing & Technology
  3. Web Design / HTML

Wrap Text Around an Image

By , About.com Guide

Once you have added an image to your Web page, you might want to have the text flow next to the image, rather than align below it. There are two ways you can do it - CSS or HTML. I recommend using CSS, as it's more standards based.

Difficulty: Easy
Time Required: 5 minutes
Here's How:
  1. Add your image to your Web page. If you have questions about how to do this, read my how to: How to Add an Image to Your Web Page.
  2. Using CSS
    Add the style attribute to your image tag:
    <img src="URL" alt="alternate text" width="width" height="height" style=" />
  3. You'll use the float style property to move your image to one side or the other. The tricky part is remembering that you're floating your image, not the text. So if you want to wrap the text on the left side of the image, you need to float that image to the right, and vice versa. So add the float property to your image:
    <img src="URL" alt="alternate text" width="width" height="height" style="float:right; />
  4. If you want your text to wrap around the right of the image, float the image to the left:
    <img src="URL" alt="alternate text" width="width" height="height" style="float:left; />
  5. Close the style property and upload your HTML to your Web server:
    <img src="URL" alt="alternate text" width="width" height="height" style="float:right;" />
  6. Using HTML
    Add the align attribute to your image tag:
    <img src="URL" alt="alternate text" width="width" height="height" align=" />
  7. To wrap text to the left, align the image to the right:
    <img src="URL" alt="alternate text" width="width" height="height" align="right />
  8. To wrap text to the right, align the image to the left:
    <img src="URL" alt="alternate text" width="width" height="height" align="left />
  9. Close the align attribute and upload your HTML to the Web server:
    <img src="URL" alt="alternate text" width="width" height="height" align="right" />
Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. Beginning HTML Tutorials
  6. How to Wrap Text Around an Image>

©2009 About.com, a part of The New York Times Company.

All rights reserved.