1. Technology

How To Wrap Text Around an Image

By

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" />
Related Video
How to Add Alt Text to a Web Page Image

©2014 About.com. All rights reserved.