Strange browser behavior with counter identifier “list-item”
TL;DR
Don’t name your counter list-item
Issue:
CSS counters are comparatively easy to understand, well documented and have good browser support.
However, I encountered unexpected behaviors with them that I do not understand and where I would like to know why this occurs. Probably just bugs in the browsers …
In the following example we can see that counters work as expected:
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
But when changing the identifier of the counter to list-item
, we can see that it behaves differently in different browsers:
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
While in Chrome and Firefox it still works as expected, in Edge and Internet Explorer 11 it starts counting from 2 and incrementing by 2, and in Safari it starts counting from 0 but still incrementing by 1.
It gets even more strange when for instance commenting out the counter-reset
property. Safari then counts correctly, but Chrome starts counting from 2. And when commenting out just counter-increment
Chrome and IE/Edge count correctly though they should actually show 0s.
There are further strange behaviors in different browsers when playing around with this, and all this only when the identifier is list-item
.
When I initially encountered the issue, my first assumption without further investigation was that it at least has to do with the display
property value list-item
. As MDN states:
The list-item keyword causes the element to generate a ::marker
pseudo-element with the content specified by its list-style properties
(for example a bullet point) together with a principal box of the
specified type for its own contents.
See: https://developer.mozilla.org/en-US/docs/Web/CSS/display-listitem
But as I could not find any further documentation on this, I wonder how different vendors can implement a similar bug like this …
Question:
Is there something I really miss here? Are there reserved words for identifiers by the spec? Is there something special about the list-item
?
In the W3C spec I can not find anything about it:
https://www.w3.org/wiki/CSS/Properties/counter-increment
https://www.w3.org/wiki/CSS/Properties/counter-reset
Additional information:
For the sake of completeness here are the used versions:
- Chrome 70.0.3538.110 MacOS Mojave 10.14.1
- Chrome 70.0.3538.110 Windows 10 17134.407
- Edge 17.17134 Windows 10 17134.407
- Firefox 63.0.3 MacOS Mojave 10.14.1
- Firefox 63.0.3 Windows 10 17134.407
- Internet Explorer 11.407.17134.0 Windows 10 17134.407
- Safari 12.0.1 MacOS Mojave 10.14.1
css css3 css-counter
add a comment |
TL;DR
Don’t name your counter list-item
Issue:
CSS counters are comparatively easy to understand, well documented and have good browser support.
However, I encountered unexpected behaviors with them that I do not understand and where I would like to know why this occurs. Probably just bugs in the browsers …
In the following example we can see that counters work as expected:
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
But when changing the identifier of the counter to list-item
, we can see that it behaves differently in different browsers:
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
While in Chrome and Firefox it still works as expected, in Edge and Internet Explorer 11 it starts counting from 2 and incrementing by 2, and in Safari it starts counting from 0 but still incrementing by 1.
It gets even more strange when for instance commenting out the counter-reset
property. Safari then counts correctly, but Chrome starts counting from 2. And when commenting out just counter-increment
Chrome and IE/Edge count correctly though they should actually show 0s.
There are further strange behaviors in different browsers when playing around with this, and all this only when the identifier is list-item
.
When I initially encountered the issue, my first assumption without further investigation was that it at least has to do with the display
property value list-item
. As MDN states:
The list-item keyword causes the element to generate a ::marker
pseudo-element with the content specified by its list-style properties
(for example a bullet point) together with a principal box of the
specified type for its own contents.
See: https://developer.mozilla.org/en-US/docs/Web/CSS/display-listitem
But as I could not find any further documentation on this, I wonder how different vendors can implement a similar bug like this …
Question:
Is there something I really miss here? Are there reserved words for identifiers by the spec? Is there something special about the list-item
?
In the W3C spec I can not find anything about it:
https://www.w3.org/wiki/CSS/Properties/counter-increment
https://www.w3.org/wiki/CSS/Properties/counter-reset
Additional information:
For the sake of completeness here are the used versions:
- Chrome 70.0.3538.110 MacOS Mojave 10.14.1
- Chrome 70.0.3538.110 Windows 10 17134.407
- Edge 17.17134 Windows 10 17134.407
- Firefox 63.0.3 MacOS Mojave 10.14.1
- Firefox 63.0.3 Windows 10 17134.407
- Internet Explorer 11.407.17134.0 Windows 10 17134.407
- Safari 12.0.1 MacOS Mojave 10.14.1
css css3 css-counter
Interesting, maybe it is the default name of the counter used internally for theol
– Gabriele Petrioli
Nov 21 '18 at 21:55
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19
add a comment |
TL;DR
Don’t name your counter list-item
Issue:
CSS counters are comparatively easy to understand, well documented and have good browser support.
However, I encountered unexpected behaviors with them that I do not understand and where I would like to know why this occurs. Probably just bugs in the browsers …
In the following example we can see that counters work as expected:
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
But when changing the identifier of the counter to list-item
, we can see that it behaves differently in different browsers:
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
While in Chrome and Firefox it still works as expected, in Edge and Internet Explorer 11 it starts counting from 2 and incrementing by 2, and in Safari it starts counting from 0 but still incrementing by 1.
It gets even more strange when for instance commenting out the counter-reset
property. Safari then counts correctly, but Chrome starts counting from 2. And when commenting out just counter-increment
Chrome and IE/Edge count correctly though they should actually show 0s.
There are further strange behaviors in different browsers when playing around with this, and all this only when the identifier is list-item
.
When I initially encountered the issue, my first assumption without further investigation was that it at least has to do with the display
property value list-item
. As MDN states:
The list-item keyword causes the element to generate a ::marker
pseudo-element with the content specified by its list-style properties
(for example a bullet point) together with a principal box of the
specified type for its own contents.
See: https://developer.mozilla.org/en-US/docs/Web/CSS/display-listitem
But as I could not find any further documentation on this, I wonder how different vendors can implement a similar bug like this …
Question:
Is there something I really miss here? Are there reserved words for identifiers by the spec? Is there something special about the list-item
?
In the W3C spec I can not find anything about it:
https://www.w3.org/wiki/CSS/Properties/counter-increment
https://www.w3.org/wiki/CSS/Properties/counter-reset
Additional information:
For the sake of completeness here are the used versions:
- Chrome 70.0.3538.110 MacOS Mojave 10.14.1
- Chrome 70.0.3538.110 Windows 10 17134.407
- Edge 17.17134 Windows 10 17134.407
- Firefox 63.0.3 MacOS Mojave 10.14.1
- Firefox 63.0.3 Windows 10 17134.407
- Internet Explorer 11.407.17134.0 Windows 10 17134.407
- Safari 12.0.1 MacOS Mojave 10.14.1
css css3 css-counter
TL;DR
Don’t name your counter list-item
Issue:
CSS counters are comparatively easy to understand, well documented and have good browser support.
However, I encountered unexpected behaviors with them that I do not understand and where I would like to know why this occurs. Probably just bugs in the browsers …
In the following example we can see that counters work as expected:
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
But when changing the identifier of the counter to list-item
, we can see that it behaves differently in different browsers:
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
While in Chrome and Firefox it still works as expected, in Edge and Internet Explorer 11 it starts counting from 2 and incrementing by 2, and in Safari it starts counting from 0 but still incrementing by 1.
It gets even more strange when for instance commenting out the counter-reset
property. Safari then counts correctly, but Chrome starts counting from 2. And when commenting out just counter-increment
Chrome and IE/Edge count correctly though they should actually show 0s.
There are further strange behaviors in different browsers when playing around with this, and all this only when the identifier is list-item
.
When I initially encountered the issue, my first assumption without further investigation was that it at least has to do with the display
property value list-item
. As MDN states:
The list-item keyword causes the element to generate a ::marker
pseudo-element with the content specified by its list-style properties
(for example a bullet point) together with a principal box of the
specified type for its own contents.
See: https://developer.mozilla.org/en-US/docs/Web/CSS/display-listitem
But as I could not find any further documentation on this, I wonder how different vendors can implement a similar bug like this …
Question:
Is there something I really miss here? Are there reserved words for identifiers by the spec? Is there something special about the list-item
?
In the W3C spec I can not find anything about it:
https://www.w3.org/wiki/CSS/Properties/counter-increment
https://www.w3.org/wiki/CSS/Properties/counter-reset
Additional information:
For the sake of completeness here are the used versions:
- Chrome 70.0.3538.110 MacOS Mojave 10.14.1
- Chrome 70.0.3538.110 Windows 10 17134.407
- Edge 17.17134 Windows 10 17134.407
- Firefox 63.0.3 MacOS Mojave 10.14.1
- Firefox 63.0.3 Windows 10 17134.407
- Internet Explorer 11.407.17134.0 Windows 10 17134.407
- Safari 12.0.1 MacOS Mojave 10.14.1
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
ol {
list-style-type: none;
counter-reset: list-counter;
}
ol>li {
counter-increment: list-counter;
}
ol>li:before {
content: counter(list-counter) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
ol {
list-style-type: none;
counter-reset: list-item;
}
ol>li {
counter-increment: list-item;
}
ol>li:before {
content: counter(list-item) '. ';
}
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
<li>n</li>
</ol>
<ol>
<li>n</li>
<li>n</li>
</ol>
css css3 css-counter
css css3 css-counter
edited Nov 22 '18 at 3:46
BoltClock♦
518k12811541194
518k12811541194
asked Nov 21 '18 at 21:49
conceptdeluxeconceptdeluxe
2,75121524
2,75121524
Interesting, maybe it is the default name of the counter used internally for theol
– Gabriele Petrioli
Nov 21 '18 at 21:55
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19
add a comment |
Interesting, maybe it is the default name of the counter used internally for theol
– Gabriele Petrioli
Nov 21 '18 at 21:55
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19
Interesting, maybe it is the default name of the counter used internally for the
ol
– Gabriele Petrioli
Nov 21 '18 at 21:55
Interesting, maybe it is the default name of the counter used internally for the
ol
– Gabriele Petrioli
Nov 21 '18 at 21:55
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19
add a comment |
1 Answer
1
active
oldest
votes
Gabriele Petrioli guessed right. list-item
is a built-in counter defined in the css-lists-3 spec, which describes it as follows:
[...] list items automatically increment the special ‘list-item’ counter. Unless the ‘counter-increment’ property manually specifies a different increment for the ‘list-item’ counter, it must be incremented by 1 on every list item, at the same time that counters are normally incremented. (This has no effect on the values of the ‘counter-*’ properties.)
This counter is not defined in CSS2 and is therefore new to css-lists-3. But it's actually really old — at least 16 years old, as far back as the FPWD of the CSS3 spec goes anyway. In general, list and counter styles are getting significant upgrades in CSS3, which means that the statement "CSS counters are comparatively easy to understand, well documented and have good browser support." might cease to be true for a while as the new spec is finalized and adopted ;) I'm not sure if the implementations or the spec came first, but presumably the implementation was added because almost no one used list-item
as a counter at the time (CSS2 adoption was nowhere near widespread in 2002 when IE6 was still brand new).
The feature itself, despite having been in the spec for over a decade, is still in limbo and interop is not expected yet. In any case, your advice is sound: don't name your counters list-item
. It is, indeed, a special keyword value for counters which due to the aforementioned interop issues will have unexpected results when used in author CSS.
Keep in mind that the W3C Wiki is not "the W3C spec", even though it is maintained by the W3C. The specs are the Working Drafts, Candidate Recommendations, Proposed Recommendations and Recommendations found as TRs in w3.org, or Editor's Drafts in dev.w3.org or wherever the respective WG decides to host their EDs. The wiki pages for the properties often don't contain any of the technical details present in the actual specs, so you're going to miss a lot of those details if you only look there.
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420948%2fstrange-browser-behavior-with-counter-identifier-list-item%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Gabriele Petrioli guessed right. list-item
is a built-in counter defined in the css-lists-3 spec, which describes it as follows:
[...] list items automatically increment the special ‘list-item’ counter. Unless the ‘counter-increment’ property manually specifies a different increment for the ‘list-item’ counter, it must be incremented by 1 on every list item, at the same time that counters are normally incremented. (This has no effect on the values of the ‘counter-*’ properties.)
This counter is not defined in CSS2 and is therefore new to css-lists-3. But it's actually really old — at least 16 years old, as far back as the FPWD of the CSS3 spec goes anyway. In general, list and counter styles are getting significant upgrades in CSS3, which means that the statement "CSS counters are comparatively easy to understand, well documented and have good browser support." might cease to be true for a while as the new spec is finalized and adopted ;) I'm not sure if the implementations or the spec came first, but presumably the implementation was added because almost no one used list-item
as a counter at the time (CSS2 adoption was nowhere near widespread in 2002 when IE6 was still brand new).
The feature itself, despite having been in the spec for over a decade, is still in limbo and interop is not expected yet. In any case, your advice is sound: don't name your counters list-item
. It is, indeed, a special keyword value for counters which due to the aforementioned interop issues will have unexpected results when used in author CSS.
Keep in mind that the W3C Wiki is not "the W3C spec", even though it is maintained by the W3C. The specs are the Working Drafts, Candidate Recommendations, Proposed Recommendations and Recommendations found as TRs in w3.org, or Editor's Drafts in dev.w3.org or wherever the respective WG decides to host their EDs. The wiki pages for the properties often don't contain any of the technical details present in the actual specs, so you're going to miss a lot of those details if you only look there.
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
add a comment |
Gabriele Petrioli guessed right. list-item
is a built-in counter defined in the css-lists-3 spec, which describes it as follows:
[...] list items automatically increment the special ‘list-item’ counter. Unless the ‘counter-increment’ property manually specifies a different increment for the ‘list-item’ counter, it must be incremented by 1 on every list item, at the same time that counters are normally incremented. (This has no effect on the values of the ‘counter-*’ properties.)
This counter is not defined in CSS2 and is therefore new to css-lists-3. But it's actually really old — at least 16 years old, as far back as the FPWD of the CSS3 spec goes anyway. In general, list and counter styles are getting significant upgrades in CSS3, which means that the statement "CSS counters are comparatively easy to understand, well documented and have good browser support." might cease to be true for a while as the new spec is finalized and adopted ;) I'm not sure if the implementations or the spec came first, but presumably the implementation was added because almost no one used list-item
as a counter at the time (CSS2 adoption was nowhere near widespread in 2002 when IE6 was still brand new).
The feature itself, despite having been in the spec for over a decade, is still in limbo and interop is not expected yet. In any case, your advice is sound: don't name your counters list-item
. It is, indeed, a special keyword value for counters which due to the aforementioned interop issues will have unexpected results when used in author CSS.
Keep in mind that the W3C Wiki is not "the W3C spec", even though it is maintained by the W3C. The specs are the Working Drafts, Candidate Recommendations, Proposed Recommendations and Recommendations found as TRs in w3.org, or Editor's Drafts in dev.w3.org or wherever the respective WG decides to host their EDs. The wiki pages for the properties often don't contain any of the technical details present in the actual specs, so you're going to miss a lot of those details if you only look there.
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
add a comment |
Gabriele Petrioli guessed right. list-item
is a built-in counter defined in the css-lists-3 spec, which describes it as follows:
[...] list items automatically increment the special ‘list-item’ counter. Unless the ‘counter-increment’ property manually specifies a different increment for the ‘list-item’ counter, it must be incremented by 1 on every list item, at the same time that counters are normally incremented. (This has no effect on the values of the ‘counter-*’ properties.)
This counter is not defined in CSS2 and is therefore new to css-lists-3. But it's actually really old — at least 16 years old, as far back as the FPWD of the CSS3 spec goes anyway. In general, list and counter styles are getting significant upgrades in CSS3, which means that the statement "CSS counters are comparatively easy to understand, well documented and have good browser support." might cease to be true for a while as the new spec is finalized and adopted ;) I'm not sure if the implementations or the spec came first, but presumably the implementation was added because almost no one used list-item
as a counter at the time (CSS2 adoption was nowhere near widespread in 2002 when IE6 was still brand new).
The feature itself, despite having been in the spec for over a decade, is still in limbo and interop is not expected yet. In any case, your advice is sound: don't name your counters list-item
. It is, indeed, a special keyword value for counters which due to the aforementioned interop issues will have unexpected results when used in author CSS.
Keep in mind that the W3C Wiki is not "the W3C spec", even though it is maintained by the W3C. The specs are the Working Drafts, Candidate Recommendations, Proposed Recommendations and Recommendations found as TRs in w3.org, or Editor's Drafts in dev.w3.org or wherever the respective WG decides to host their EDs. The wiki pages for the properties often don't contain any of the technical details present in the actual specs, so you're going to miss a lot of those details if you only look there.
Gabriele Petrioli guessed right. list-item
is a built-in counter defined in the css-lists-3 spec, which describes it as follows:
[...] list items automatically increment the special ‘list-item’ counter. Unless the ‘counter-increment’ property manually specifies a different increment for the ‘list-item’ counter, it must be incremented by 1 on every list item, at the same time that counters are normally incremented. (This has no effect on the values of the ‘counter-*’ properties.)
This counter is not defined in CSS2 and is therefore new to css-lists-3. But it's actually really old — at least 16 years old, as far back as the FPWD of the CSS3 spec goes anyway. In general, list and counter styles are getting significant upgrades in CSS3, which means that the statement "CSS counters are comparatively easy to understand, well documented and have good browser support." might cease to be true for a while as the new spec is finalized and adopted ;) I'm not sure if the implementations or the spec came first, but presumably the implementation was added because almost no one used list-item
as a counter at the time (CSS2 adoption was nowhere near widespread in 2002 when IE6 was still brand new).
The feature itself, despite having been in the spec for over a decade, is still in limbo and interop is not expected yet. In any case, your advice is sound: don't name your counters list-item
. It is, indeed, a special keyword value for counters which due to the aforementioned interop issues will have unexpected results when used in author CSS.
Keep in mind that the W3C Wiki is not "the W3C spec", even though it is maintained by the W3C. The specs are the Working Drafts, Candidate Recommendations, Proposed Recommendations and Recommendations found as TRs in w3.org, or Editor's Drafts in dev.w3.org or wherever the respective WG decides to host their EDs. The wiki pages for the properties often don't contain any of the technical details present in the actual specs, so you're going to miss a lot of those details if you only look there.
edited Nov 22 '18 at 3:54
answered Nov 22 '18 at 3:38
BoltClock♦BoltClock
518k12811541194
518k12811541194
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
add a comment |
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
Absolutely - Thanks for the detailed information!
– conceptdeluxe
Nov 22 '18 at 9:53
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420948%2fstrange-browser-behavior-with-counter-identifier-list-item%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Interesting, maybe it is the default name of the counter used internally for the
ol
– Gabriele Petrioli
Nov 21 '18 at 21:55
not able to find a potential duplicate .. will call the Master!
– Temani Afif
Nov 21 '18 at 21:58
@Gabriele Petrioli: You are correct; see my answer.
– BoltClock♦
Nov 22 '18 at 4:19