tags:

views:

32

answers:

1

Hi guys,

I have already found following question with almost similar content: http://stackoverflow.com/questions/3797713/how-to-indent-list-items-using-css-when-you-have-floating-blocks

And here is my situation: if a list item gets too long, so that it automatically makes a line break, the text flow continues without the indentation.

Here is what I am expecting:

I can handle this using outside position property, modifying the margin or padding of an li element, if the text height is smaller than the image height. But if the text continues, especially on the bottom border of the image - it looks totally destroyed.

A good code to play with can be found here: http://csscreator.com/node/30984 on the second post.

Any help will be deeply appreciated

A: 

The most obvious, and simple solution, is to clear the list so that it's forced down under the floated elements, instead of sharing the same space as floated image, for instance, in this jsfiddle.

img {
    float: left;
}

ol {
    clear: both;
}

Of course, there will be other problems depending on the situation you're using this in, but otherwise it should solve your problem.

Yi Jiang
of first of all thank you for answering. My Problem is, that the floating image is not that small, that i can use your solution, but it is also not so big, so that i could just make two columns and format them separately.you can see an example here:
eXtide
http://hps-server.de/568/produkttest/so my goal is to place bullets on the same vertical line with the normal text begins and to hold the list indent both near and under the image (with automatical line break), like drawn in my last post.any suggestions how to do this?
eXtide
@eXtide Well, there's no real "solution" to this. It's either two columns, or clearing the list, unless you want to specify which of the lists to clear and which not to - there's no way the list can be made to pull itself together if it were split apart by the floated image
Yi Jiang