Skip to content

Commit aa8f239

Browse files
Add an example explaining how to use counters in alt text (#12474)
Explain how to set up a fallback when using counter in alt text in unsupported browsers. Requested in I2S process: https://groups.google.com/a/chromium.org/g/blink-dev/c/Ec36bxU5lok/m/5ljOQJS6BQAJ
1 parent c50033e commit aa8f239

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

css-content-3/Overview.bs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,19 @@ Inserting and Replacing Content: the 'content' property</h2>
210210
the element has no "alt text".
211211
</dl>
212212

213+
<div class="example">
214+
To correctly use <<counter>> in "alt text" in unsupported browsers
215+
one should specify 'content' property twice.
216+
First, a fallback without counter in "alt text".
217+
Second, use counter in "alt text".
218+
<pre>
219+
::before {
220+
content: "Chapter" counter(chapter);
221+
content: "Chapter" counter(chapter) / "Chapter" counter(chapter);
222+
}
223+
</pre>
224+
</div>
225+
213226
Issue: Should the contents keyword be replaced with ''content()''?
214227

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

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

1400-
No new security considerations have been reported on this specification.
1413+
No new security considerations have been reported on this specification.

0 commit comments

Comments
 (0)