sorin sorin - 1 year ago 142
CSS Question

How to indent list items using CSS when you have floating blocks?

I observed a relative strange behavior when I use floating images in a document. The list items indentation is made relatively to the 'red line' instead of the 'green' one.

Why is this happening and can I solve this?

<img style="float: left">
<p>some text</p>
<p>some other text</p>

alt text

Answer Source

Just add ul { list-style-position: inside; } because by default it is set to outside, not sure why.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download