diff --git a/src/guide/a11y-semantics.md b/src/guide/a11y-semantics.md index 255e832401..e6f294aeb7 100644 --- a/src/guide/a11y-semantics.md +++ b/src/guide/a11y-semantics.md @@ -21,7 +21,7 @@ Labels are typically placed on top or to the left of the form fields: ``` - + Notice how you can include `autocomplete='on'` on the form element and it will apply to all inputs in your form. You can also set different [values for autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for each input. @@ -34,7 +34,7 @@ Provide labels to describe the purpose of all form control; linking `for` and `i ``` - + If you inspect this element in your chrome developer tools and open the Accessibility tab inside the Elements tab, you will see how the input gets its name from the label: @@ -68,7 +68,7 @@ You can also give the input an accessible name with [`aria-label`](https://devel /> ``` - + Feel free to inspect this element in Chrome DevTools to see how the accessible name has changed: @@ -100,7 +100,7 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi ``` - + ![Chrome Developer Tools showing input accessible name from aria-labelledby](/images/AccessibleARIAlabelledbyDevTools.png) @@ -132,7 +132,7 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi ``` - + You can see the description by inspecting Chrome DevTools: @@ -144,7 +144,7 @@ Avoid using placeholders as they can confuse many users. One of the issues with placeholders is that they don't meet the [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) by default; fixing the color contrast makes the placeholder look like pre-populated data in the input fields. Looking at the following example, you can see that the Last Name placeholder which meets the color contrast criteria looks like pre-populated data: - + It is best to provide all the information the user needs to fill out forms outside any inputs. @@ -178,7 +178,7 @@ Alternatively, you can attach the instructions to the input with [`aria-describe ``` - + ### Hiding Content @@ -212,7 +212,7 @@ We can use CSS to visually hide elements but keep them available for assistive t } ``` - + #### aria-hidden="true" @@ -240,7 +240,7 @@ You can also use an input to create buttons: ``` - + #### Functional Images @@ -276,4 +276,4 @@ You can use this technique to create functional images. ``` - +