Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have text wrap around an image?

Tags:

html

css

What's the best approach to achieve the following effect?

[Image Removed by Poster]

I need that text to wrap around the image, which should always be in the bottom right corner. Thanks.

like image 732
Jared Avatar asked Feb 24 '11 07:02

Jared


People also ask

How do I wrap text around an image in CSS?

Enter . left { float: left; padding: 0 20px 20px 0;} to the stylesheet to use the CSS "float" property. (Use right to align the image to the right.) If you view your page in a browser, you'll see the image is aligned to the left side of the page and the text wraps around it.

How do I wrap text around an image in HTML?

Use the markup code <BR CLEAR=”left” /> to flow text around images on opposite sides of your Web pages. One of the first things you may want to do is place an image on the page.

What is image text wrapping?

Text Wrap Options This text wrap works best with images that have no background. Top and Bottom—Text stops when it hits the top of the image and continues at the bottom of the image; no text is to the left or right of the image. Behind text—Image is behind text.

How do you do wrap text?

Wrap text automaticallyOn the Home tab, in the Alignment group, click Wrap Text. (On Excel for desktop, you can also select the cell, and then press Alt + H + W.) Notes: Data in the cell wraps to fit the column width, so if you change the column width, data wrapping adjusts automatically.


3 Answers

you will not succeed on this with pure html/css but if javascript is an option for you might want to have a look at

  • http://code.google.com/p/jqslickwrap/
  • http://www.webappers.com/2008/01/10/css-text-wrapper-makes-hthml-text-wrap-in-shapes/
like image 102
Daniel Kutik Avatar answered Oct 09 '22 12:10

Daniel Kutik


Unfortunately you won't be able to get text to wrap around an image like in publishing software and your example above. What you can do is set the image to float to the right or align to the right and assign margin left to it which will pad the text off of it.

Live example here: http://jsfiddle.net/2bjn3/

like image 24
Dan Avatar answered Oct 09 '22 10:10

Dan


Actually is is possible if you're not opposed to non-semantic markup. Take a look at this working example:

http://jsfiddle.net/chprpipr/Zhz2v/

If you set the background image of the container to contain your portrait image, you can get pretty close to what you're looking for.

like image 23
chprpipr Avatar answered Oct 09 '22 10:10

chprpipr