Skip to content

Commit 6ac55cb

Browse files
committed
[css-pseudo] remove alt (moved to css-content)
1 parent 98fb9ea commit 6ac55cb

File tree

2 files changed

+114
-204
lines changed

2 files changed

+114
-204
lines changed

css-pseudo/Overview.bs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -578,56 +578,6 @@ Generated Content Pseudo-elements: ''::before'' and ''::after''</h2>
578578
(<code>:before</code> and <code>:after</code>)
579579
for these pseudo-elements.
580580

581-
<h3 id="alt-property">
582-
Alternative text for Generated Content: The 'alt' property</h3>
583-
584-
The generated content of a ::before or ::after element is not always appropriate for assistive technology. In these cases, alternative text can be provided using the 'alt' property. The 'alt' property applies only to the same elements the 'content' property applies to.
585-
586-
<pre class=propdef>
587-
Name: alt
588-
Value: none | <<string>>
589-
Initial: none
590-
Applies to: ::before and ::after pseudo-elements
591-
Inherited: no
592-
Computed Value: as specified
593-
</pre>
594-
595-
<dl>
596-
<dt>none</dt>
597-
<dd>No alternative text</dd>
598-
599-
<dt><<string>></dt>
600-
<dd>The alternative text is the <<string>>. This can be the empty string.</dd>
601-
</dl>
602-
603-
When the alt property computes to anything other than none, the alternative <<string>> should be used instead of the value of the contents property by assistive technology.
604-
605-
<div class="example">
606-
607-
Here the content property is an image, so the alt property is required to provide alternative text.
608-
609-
<pre>
610-
.new::before {
611-
content: url(./img/star.png);
612-
alt: "New!";
613-
}
614-
</pre>
615-
</div>
616-
617-
<div class="example">
618-
619-
If the pseudo-element is purely decorative and its function is covered elsewhere, setting alt to the empty string can avoid reading out the decorative element. Here the ARIA attribute will be spoken as "collapsed". Without the empty string alt value, the content would also be spoken as "Black right-pointing pointer".
620-
621-
<pre>
622-
.expandable::before {
623-
content: "\25BA"; /* a.k.a. ► */
624-
alt: "";
625-
/* aria-expanded="false" already in DOM,
626-
so this pseudo-element is decorative */
627-
}
628-
</pre>
629-
</div>
630-
631581
<h2 id="interactions">Overlapping Pseudo-element Interactions</h2>
632582

633583
<div class="example" id="overlapping-example">

0 commit comments

Comments
 (0)