demo · v140
Nested TOC
Multi-level table-of-contents numbering — 1., 1.1, 1.1.1 — driven by counters() in both the visual content and the alt text. The visual side reads "1.2.3"; the screen-reader side reads "Subsection one dot two dot three".
- Foreword
- About the author
- Getting started
- Installing the toolchain
- The hello world example
- JS
- HTML
- Going further
- Routing
- State management
Visual numbering uses the same counters() call as the alt text — but the two sides are joined by the new / separator in content.
li::before {
content:
counters(section, ".") ". " /* visible: "1.2.3. " */
/
"Subsection " counters(section, " dot ") " — "; /* alt: "Subsection 1 dot 2 dot 3 — " */
}
see also
- counter() / counters() in alt — feature index
- ChromeStatus entry
- Spec