For context, see Lists <ul> and <ol> with left-floated images render completely differently in Blink & Gecko #650 .


Default styling

In this first example, the floats are contained via overflow:hidden .

Notice the markers in relation to the floated element inside the list items:

If we can't see the markers in Firefox it is because this browser, unlike Chrome, position the markers outside the list items and their styling ( overflow:hidden ) "clips" the marker.

  1. Some text next to an image inside a "floated" link.

  2. Some text next to an image inside a "floated" link.

  3. Some text next to an image inside a "floated" link.

Showing the markers in Firefox

Instead of making each list-item a block-formatting context, we rely on each LI to clear the previous one (we contain the last one by styling the OL itself).

Notice the position of the markers in relation to the floated element inside the list items:

  1. Some text next to an image inside a "floated" link.

  2. Some text next to an image inside a "floated" link.

  3. Some text next to an image inside a "floated" link.

WTF?

Even though I'd expect things to work like it does in Firefox, I'm not sure how this browser would handle the ::marker pseudo-element—see 6 Markers: The ::marker pseudo-element ( Working Draft) :

Like ::before and ::after, the ::marker pseudo-element can be styled with the full range of CSS properties and values, exactly like a real element. Markers are placed at the beginning of their originating element’s content, before the ::before pseudo-element (if it exists). ::marker pseudo-elements are inline by default, though certain values for list-style-position on the list item can make the marker box positioned, which can have an effect on the computed value of display.

Because, as far as I know, following this recommendation would lead to the exact same behavior we see in Chrome; with the float showing before the marker.

Hacking stuff

To achieve consistency across browsers we could get rid of the native markers and use a pseudo-element to mimic the real thing.

  1. Some text next to an image inside a "floated" link.

  2. Some text next to an image inside a "floated" link.

  3. Some text next to an image inside a "floated" link.

Note that once we can use ::marker we should be able to rely on the styling of that pseudo-element to achieve the same display across browsers.

Update

The following is to address issues reported in this comment :

To take care of the above, we can rely on position:absolute :

  1. Some text next to an image inside a "floated" link. More text to show the indentation below the float: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

  2. Some text next to an image inside a "floated" link.

  3. Some text next to an image inside a "floated" link.

  4. Some text next to an image inside a "floated" link.

  5. Some text next to an image inside a "floated" link.

  6. Some text next to an image inside a "floated" link. More text to show the indentation below the float: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

  7. Some text next to an image inside a "floated" link.

  8. Some text next to an image inside a "floated" link.

  9. Some text next to an image inside a "floated" link.

  10. Some text next to an image inside a "floated" link.

  11. Some text next to an image inside a "floated" link.

  12. Some text next to an image inside a "floated" link.