I described my original problem in this thread.
In short, when using custom counters in ULs, the text indentation broke.
Marc Audet proposed a very elegant solution which I implemented in our code.
Now - not surprising - this does not work if the list is supposed to float around images :-(
You can see the problem here: http://cssdesk.com/eEvwn
The numbers are lying on top of the image. Again: no surprise, they are absolutely positioned after all.
So. Is there a way to fix this, or do I have to make my client unhappy by telling him it's technically not possible?
Thank you again for taking the time to answer.
If you need more info, please let me know.
I guess from the CSSdesk that you post that you want the indentation to be similar to what shows in the bottom panel.
First, you want the numbers to be off the text. You can get this by setting a margin-left that matches the width:
Since the margin left is the same amount than the width, it doesn't take space.
And, to adjust the global position, set:
In your original code, this is margin-right. I would say that this is an error, doesn't seem to make sense to adjust the margin right
I revisited my previous solution and made some modifications to the CSS as follows.
For the top-level list:
and for the nested list:
Essentially, I removed the absolutely positioned pseudo-elements since those will not work near floated content.
However, because of the negative-margin for the pseudo-elements, the labels could still overlap the floated images, so add
overflow: hidden
to the top levelli
style and this creates a new block formatting context which takes care of the over lap issue.Downside: depending on your content and the floated image, you can get some large chunks of white space as shown in my new demo:
http://jsfiddle.net/audetwebdesign/buXKy/