demo · v138
counter() / counters() in content alt text
The visual marker uses upper-roman, but the accessibility tree gets a plain "Section 1" via the alt-text half of content. Add or remove sections, then peek the alt text the AT actually reads.
checking support…
- Introduction
- Background
- Conclusion
accessible name read for each ::before pseudo (computed from alt text):
the code
li::before {
/* Slash separates visual content from alt text */
content: "§ " counter(section, upper-roman) " "
/ "Section " counter(section);
}
see also
- CSS counter() / counters() in alt text — feature index
- ChromeStatus entry
- Spec