Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap a list around a block/image?

I'm trying to wrap a list around a block and IE doesn't make my life easier.

The block is floating on the left, so I expect the list to be on the right. While it works in all browsers, it looks pretty ugly in IE, because IE puts the text on the right and the bullets on the left of the image.

Look at the example: http://jsfiddle.net/xA9n8/

How to fix this?

UPD: I tested it in IE9.

like image 224
Daniel J F Avatar asked Jun 07 '11 05:06

Daniel J F


People also ask

How do I wrap text around an image HTML?

Use the markup code <BR CLEAR=”left” /> to flow text around images on opposite sides of your Web pages.

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.

Which of the following is used for wrapping text around images?

Wrapping the text around an image is quite attractive for any kind of website.By using HTML and CSS wrapping an image with the text is possible and there are many ways to do so because the shape of any image is not constant.

Which property is used to flow text around an image?

In order to get the text to flow around the image, you need to use the CSS property called float. In principle, using float is very simple, and it can be used on any HTML element, not just images.


2 Answers

For the googlez:

#somebox ul li {
  list-style-position: inside;
}
like image 119
John Glass Avatar answered Sep 20 '22 16:09

John Glass


Giving the list items the property float:left; seems to work. You may want to insert a <div style="clear: left;" /> afterwards to prevent further elements from floating.

like image 42
phihag Avatar answered Sep 20 '22 16:09

phihag