Skip to content

Commit

Permalink
form label descriptive: Tweak the examples (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed May 16, 2022
1 parent 9a7cd94 commit 9f6ca37
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions _rules/form-field-label-descriptive-cc0f0a.md
Expand Up @@ -140,11 +140,11 @@ The `label` elements are [programmatic labels][programmatic label] of their resp

```html
<html lang="en">
<h2>Shipping address</h2>
<h2>Shipping</h2>
<label>Name<input id="shipping-name" type="text" name="name"/></label>
<label>Street<input id="shipping-street" type="text" name="street"/></label>

<h2>Billing address</h2>
<h2>Billing</h2>
<label>Name<input id="billing-name" type="text" name="name"/></label>
<label>Street<input id="billing-street" type="text" name="street"/></label>
</html>
Expand All @@ -156,7 +156,7 @@ Both the `div` and the `span` elements are [programmatic labels][programmatic la

```html
<html lang="en">
<div id="shipping">Shipping address</div>
<div id="shipping">Shipping</div>
<span id="name">Name</span>
<input id="shipping-name" type="text" name="name" aria-labelledby="shipping name" />
</html>
Expand Down Expand Up @@ -202,11 +202,11 @@ The `label` elements are [programmatic labels][programmatic label] of their resp

```html
<html lang="en">
<h2 style="position: absolute; top: -9999px; left: -9999px;">Shipping address</h2>
<h2 style="position: absolute; top: -9999px; left: -9999px;">Shipping</h2>
<input aria-label="Name" id="shipping-name" type="text" name="name" />
<input aria-label="Street" id="shipping-street" type="text" name="street" />

<h2 style="position: absolute; top: -9999px; left: -9999px;">Billing address</h2>
<h2 style="position: absolute; top: -9999px; left: -9999px;">Billing</h2>
<input aria-label="Name" id="billing-name" type="text" name="name" />
<input aria-label="Street" id="billing-street" type="text" name="street" />
</html>
Expand All @@ -218,7 +218,7 @@ Both the `div` and the `span` elements are [programmatic labels][programmatic la

```html
<html lang="en">
<div id="shipping">Shipping address</div>
<div id="shipping">Shipping</div>
<span id="name" style="display: none">Name</span>
<input id="shipping-name" type="text" name="name" aria-labelledby="shipping name" />
</html>
Expand Down

0 comments on commit 9f6ca37

Please sign in to comment.