标签云

微信群

扫码加入我们

WeChat QR Code

I can't be sure if my code is sucking, or if it's just that the browsers haven't caught up with the spec yet.

My goal is to simulate list markers using generated content, so as to get e.g. continuation of the counters from list to list in pure CSS.

So the code below, which I think is correct according to the spec, is like this:

html {
  counter-reset: myCounter;
}
li {
  counter-increment: myCounter;
}
li:before {
  content: counter(myCounter)". ";
  display: marker;
  width: 5em;
  text-align: right;
  marker-offset: 1em;
}
<ol>
  <li>The<li>
  <li>quick</li>
  <li>brown</li>
</ol>
<ol>
  <li>fox</li>
  <li>jumped</li>
  <li>over</li>
</ol>

But this doesn't seem to generate markers, in either FF3, Chrome, or IE8 beta 2, and if I recall correctly not Opera either (although I've since uninstalled Opera).

So, does anyone know if markers are supposed to work? Quirksmode.org isn't being its usual helpful self in this regard :(.


There is display: -moz-marker, but I haven’t got that to work either.

2018年08月16日19分02秒