You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
### <a id="10-03"></a>If you can use a native HTML element, then do so.
1944
+
#### <a href="#10-03">Style 10-03</a>
1945
+
.s-rule.do
1946
+
:marked
1947
+
**Do** use native HTML elements where possible.
1948
+
1949
+
.s-rule.avoid
1950
+
:marked
1951
+
**Avoid** recreating elements such as `input`, `button` and `a` with `div` and `span`.
1952
+
1953
+
.s-why
1954
+
:marked
1955
+
**Why?** Native HTML elements contain a lot of built in functionality.
1956
+
1957
+
.s-why
1958
+
:marked
1959
+
**Why?** Native HTML elements are instantly understood by all browsers and assistive technologies, such as screen readers.
1960
+
1961
+
.s-why.s-why-last
1962
+
:marked
1963
+
**Why?** Native HTML elements automatically follow expected interaction patterns.
1964
+
1965
+
.l-main-section
1966
+
:marked
1967
+
### <a id="10-04"></a>Always support and test keyboard navigation.
1968
+
#### <a href="#10-04">Style 10-04</a>
1969
+
.s-rule.do
1970
+
:marked
1971
+
**Do** unplug your mouse and test if al functionality on your page can be reached and activated with `TAB`, `SHIFT+TAB`, `ENTER`, `SPACE` and the arrow keys alone.
1972
+
1973
+
.s-rule.avoid
1974
+
:marked
1975
+
**Avoid** any functional areas that cannot be reached this way.
1976
+
1977
+
.s-why
1978
+
:marked
1979
+
**Why?** People who cannot use a mouse due to disability or injury navigate with the keyboard alone or other related technologies.
1980
+
1981
+
.s-why.s-why-last
1982
+
:marked
1983
+
**Why?** People with visual disabilities requiring the assistance of screen readers also exclusively navigate with the keyboard alone or other related technologies.
1984
+
1985
+
.l-main-section
1986
+
:marked
1987
+
### <a id="10-05"></a>Use `dl` to display the read-only state of interactive controls / form controls.
1988
+
#### <a href="#10-05">Style 10-05</a>
1989
+
.s-rule.do
1990
+
:marked
1991
+
**Do** display read only key-value data as a definition list.
1992
+
1993
+
.s-rule.avoid
1994
+
:marked
1995
+
**Avoid** using the `label` tag without a related interactive control / form control.
1996
+
1997
+
.s-rule.avoid
1998
+
:marked
1999
+
**Avoid** using only `div` and `span` to display related key-value data.
2000
+
2001
+
.s-why
2002
+
:marked
2003
+
**Why?** Assistive technologies, such as screen readers recognize the `dl` as containing related key-value pairs.
2004
+
2005
+
.s-why.s-why-last
2006
+
:marked
2007
+
**Why?** Unrelated `label` tags are considered invalid HTML and not recognized by assistive technologies.
2008
+
2009
+
.l-main-section
2010
+
:marked
2011
+
### <a id="10-06"></a>Provide a label for all interactive controls / form controls and groups of controls.
2012
+
#### <a href="#10-06">Style 10-06</a>
2013
+
.s-rule.do
2014
+
:marked
2015
+
**Do** associate a `label` element with every interactive control / form control.
2016
+
2017
+
.s-rule.do
2018
+
:marked
2019
+
**Do** place groups of related interactive controls / form controls in a `fieldset` and label with `legend`.
2020
+
2021
+
.s-rule.avoid
2022
+
:marked
2023
+
**Avoid** unlabelled interactive controls / form controls.
2024
+
2025
+
.s-rule.avoid
2026
+
:marked
2027
+
**Avoid** any unassociated labels.
2028
+
2029
+
.s-why
2030
+
:marked
2031
+
**Why?** All users need to know the meaning of each interactive control / form control.
2032
+
2033
+
.s-why
2034
+
:marked
2035
+
**Why?** Users with visual disabilities are also unable to assume the meaning based on visual position.
2036
+
2037
+
.s-why.s-why-last
2038
+
:marked
2039
+
**Why?** Associated labels also become clickable making it easier to select interactive controls / form controls.
2040
+
2041
+
.l-main-section
2042
+
:marked
2043
+
### <a id="10-07"></a>Use links for navigation and buttons for activation.
2044
+
#### <a href="#10-07">Style 10-07</a>
2045
+
.s-rule.do
2046
+
:marked
2047
+
**Do** use `a` tag links to navigate to other pages.
2048
+
2049
+
.s-rule.do
2050
+
:marked
2051
+
**Do** use `buttons` to activate user actions requiring a response.
2052
+
2053
+
.s-rule.avoid
2054
+
:marked
2055
+
**Avoid** mixing these elements and functions.
2056
+
2057
+
.s-why
2058
+
:marked
2059
+
**Why?** Links are recognised by assistive technologies, expected to trigger a navigation and to be activated with `ENTER` alone.
2060
+
2061
+
.s-why.s-why-last
2062
+
:marked
2063
+
**Why?** Buttons are recognised by assistive technologies, expected to trigger a user action and to be activated with either `ENTER` or `SPACE`.
2064
+
2065
+
.l-main-section
2066
+
:marked
2067
+
### <a id="10-08"></a>Provide descriptive text for your HTML elements.
2068
+
#### <a href="#10-08">Style 10-08</a>
2069
+
.s-rule.do
2070
+
:marked
2071
+
**Do** provide descriptive text for elements such as `buttons` pertaining to the meaning of the element.
2072
+
2073
+
.s-rule.avoid
2074
+
:marked
2075
+
**Avoid** possible repetitive text for your elements as repetition causes confusion.
2076
+
2077
+
.s-why
2078
+
:marked
2079
+
**Why?** Due to functionality such as `*ngFor` it is possible to create multiple instances of one HTML partial. A button stating *Save Rubberman* is then clearer than *Save Hero*.
2080
+
2081
+
.s-why.s-why-last
2082
+
:marked
2083
+
**Why?** This severly impacts users relying on screen readers where multiple occurances of elements with the same text can cause the page to become unusable.
2084
+
2085
+
.l-main-section
2086
+
:marked
2087
+
### <a id="10-09"></a>Provide alternative text for all your images.
2088
+
#### <a href="#10-09">Style 10-09</a>
2089
+
.s-rule.do
2090
+
:marked
2091
+
**Do** provide descriptive text for all images using the `alt` attribute.
2092
+
2093
+
.s-rule.avoid
2094
+
:marked
2095
+
**Avoid** any images not described by text.
2096
+
2097
+
.s-why.s-why-last
2098
+
:marked
2099
+
**Why?** Users with visual disabilites will be unable to discern the meaning of images without an alternative textual description.
2100
+
2101
+
.l-main-section
2102
+
:marked
2103
+
### <a id="10-10"></a>Provide good textual color contrast
2104
+
#### <a href="#10-10">Style 10-10</a>
2105
+
.s-rule.do
2106
+
:marked
2107
+
**Do** provide a color contrast ratio of at least `4.5:1` between the text color and the text background color for small text .
2108
+
2109
+
.s-rule.do
2110
+
:marked
2111
+
**Do** provide a color contrast ratio of at least `3:1` between the text color and the text background color for large text.
2112
+
2113
+
.s-rule.do
2114
+
:marked
2115
+
**Do** use one of many freely available color contrast test tools to achieve this.
2116
+
2117
+
.s-rule.avoid
2118
+
:marked
2119
+
**Avoid** providing textual contrast below these levels.
2120
+
2121
+
.s-why
2122
+
:marked
2123
+
**Why?** Users with limited vision, who are not reliant on screen readers, may be unable to read text not conforming to these contrast ratios.
2124
+
2125
+
.s-why.s-why-last
2126
+
:marked
2127
+
**Why?** These ratios provide an enhanced reading experience for all users in a larger range of ambient light conditions.
2128
+
2129
+
.l-main-section
2130
+
:marked
2131
+
### <a id="10-11"></a>Avoid full reliance on color alone to convey meaning.
2132
+
#### <a href="#10-11">Style 10-11</a>
2133
+
.s-rule.do
2134
+
:marked
2135
+
**Do** provide readable text to convey all application-critical information.
2136
+
2137
+
.s-rule.avoid
2138
+
:marked
2139
+
**Avoid** only using color to convey application-critical information, i.e. *"Click on the green button"*.
2140
+
2141
+
.s-why.s-why-last
2142
+
:marked
2143
+
**Why?** Users with visual disabilites will be unable to recognize this important application information and therefore be unable to use it.
0 commit comments