Skip to content

[css-content] Add an example explaining how to use counters in alt text #12474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion css-content-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ Inserting and Replacing Content: the 'content' property</h2>
the element has no "alt text".
</dl>

<div class="example">
To correctly use <<counter>> in "alt text" in unsupported browsers
one should specify 'content' property twice.
First, a fallback without counter in "alt text".
Second, use counter in "alt text".
<pre>
::before {
content: "Chapter" counter(chapter);
content: "Chapter" counter(chapter) / "Chapter" counter(chapter);
}
</pre>
</div>

Issue: Should the contents keyword be replaced with ''content()''?

<h3 id="accessibility">
Expand Down Expand Up @@ -1397,4 +1410,4 @@ No new privacy considerations have been reported on this specification.

<h2 class=no-num id=security>Security Considerations</h2>

No new security considerations have been reported on this specification.
No new security considerations have been reported on this specification.