diff --git a/techniques/css/C42.html b/techniques/css/C42.html index a5ba9c3e07..b70567c6bb 100644 --- a/techniques/css/C42.html +++ b/techniques/css/C42.html @@ -1,11 +1,11 @@
-The objective of this technique is to ensure that links in navigation or pagination menus will be spaced so that they fall within an area that measures at least 44 x 44 CSS pixels if the target area itself is smaller than that. The aim is to provide an adequate target clearance so the offset to adjacent targets is sufficient to prevent accidental pointer activation of adjacent targets.
- +The objective of this technique is to ensure that navigation or pagination links measure at least 44 by 44 CSS pixels. The aim is for target sizes to be large enough for users to easily activate them.
The following examples can be seen as rendered versions in the working examples.
- -The first example shows a situation where the targets (in this case, the linked numbers in th pagination menu) are smaller than 44 x 44 CSS pixels. However, the list items that contain them have a minimum height and width of 44 px set, so that sufficient target spacing is assured.
-
- Given the following HTML:
-<nav class="pag" aria-label="pagination menu">
- <ol class="pagination-1">
- <li><span>previous</span></li>
- <li><strong>1</strong></li>
- <li><a href="#">2</a></li>
- <li><a href="#">3</a></li>
- <li><a href="#">4</a></li>
- <li><a href="#">5</a></li>
- <li><a href="#">next</a></li>
- </ol>
-</nav>
- The following CSS would ensure the minimum spacing is applied:
-ol.pagination-1 li {
- display: inline-block;
- min-width: 44px;
- min-height: 44px;
-}
-
- The following example can be seen as a working example.
The second example uses min-width and min-height on the targets (the linked numbers in the pagination menu) and not on the parent container, thereby meeting this target spacing Success Criterion and incidentally also the AAA Success Criterion 2.5.5 Target Size.
+This example uses min-width and min-height on the targets.
-
+ Given the following HTML:
-<nav class="pag" aria-label="pagination menu">
- <ol class="pagination-2">
- <li><span>previous</span></li>
- <li><strong>1</strong></li>
- <li><a href="#">2</a></li>
- <li><a href="#">3</a></li>
- <li><a href="#">4</a></li>
- <li><a href="#">5</a></li>
- <li><a href="#">next</a></li>
- </ol>
- </nav>
- The following CSS ensures the minimum size is applied:
-ol.pagination-2 a,
-ol.pagination-2 strong,
-ol.pagination-2 span {
- display: block;
- line-height:44px;
- min-height:44px;
- min-width: 44px;
+ The HTML
+<nav aria-label="pagination">
+ <ol class="pagination-list">
+ <li><a>previous</a></li>
+ <li><a aria-current="page"><span class="visually-hidden">page </span>1</a></li>
+ <li><a href="/page-2"><span class="visually-hidden">page </span>2</a></li>
+ <li><a href="/page-3"><span class="visually-hidden">page </span>3</a></li>
+ <li><a href="/page-4"><span class="visually-hidden">page </span>4</a></li>
+ <li><a href="/page-5"><span class="visually-hidden">page </span>5</a></li>
+ <li><a href="/page-2">next</a></li>
+ </ol>
+</nav>
+ The CSS
+.pagination-list{
+ display: flex;
+ gap: 0.5em;
+ list-style: none;
+ padding: 0;
+}
+
+.pagination-list li{
+ padding: 0.25em;
+}
+
+.pagination-list a{
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ min-height: 44px;
+ min-width: 44px;
+ padding: 0.5em;
}
For each target that cannot be enlarged by a mechanism, is not inline, and is not covered by the essential exception:
-For each target that is not inline and is not covered by the essential exception:
+CSS
+ +All technologies that support CSS and pointer input.
+The objective of this technique is to ensure that links in navigation menus have enough spacing around them to meet the requirements of the spacing exception in Success Criterion 2.5.8, Target Size (Minimum). The aim is to provide an adequate target clearance to prevent accidental pointer activation of adjacent targets.
+The following example can be seen as a working example.
+ +This example shows a situation where targets are smaller than 24 CSS pixels wide and 24 CSS pixels high. To meet Success Criterion 2.5.8, Target Size (Minimum), when a 24 CSS pixel diameter circle is centered on the bounding box of each target, the circles do not intersect another target or the circle for another undersized target. In this example, each target is 20 × 20 CSS pixels, and a 4 CSS pixel gap is added between each target's parent container to create the minimum required spacing.
+
+ <nav aria-label="controls">
+ <ol class="navigation-controls">
+ <li><a href="/previous-page/"><img alt="Back" src="arrow-back.svg"></a></li>
+ <li><a href="/next-page/"><img alt="Forward" src="arrow-forward.svg"></a></li>
+ <li>
+ <a href="mailto:c42@example.com?subject=WCAG%20C42%20Technique">
+ <img alt="Email" src="email.svg">
+ </a>
+ </li>
+ <li><a href="/"><img alt="Home" src="home.svg"></a></li>
+ </ol>
+</nav>
+ .navigation-controls{
+ display: flex;
+ gap: 4px;
+ line-height: 0;
+ list-style: none;
+ padding: 0;
+}
+
+.navigation-controls a{
+ display: inline-block;
+ line-height: 0;
+}
+
+ For each undersized target that has no equivalent, that isn't in a sentence or otherwise constrained by the line-height of non-target text, that hasn't had its size modified by the author, and whose presentation isn't essential:
+Each numbered item in this section represents a technique or combination of techniques that the WCAG Working Group deems sufficient for meeting this Success Criterion. However, it is not necessary to use these particular techniques. For information on using other techniques, see Understanding Techniques for WCAG Success Criteria, particularly the "Other Techniques" section.
Techniques that are sufficient to meet the Guideline or Success Criterion.
+Techniques that are sufficient to meet the Guideline or Success Criterion. See example in C42, Using CSS to ensure sufficient target size.
This example relates to technique C42.
- -The first example shows a situation where the targets (in this case, the linked numbers in th pagination menu) are smaller than 44 x 44 CSS pixels. However, the list items that contain them have a minimum height and width of 44 px set, so that sufficient target spacing is assured.
-HarperCollins, 1800. Condition: Good.
-Real People Press, 1804. Shows some signs of wear, and may have some markings on the inside.
-1838. Condition: Very Good. Published by Belmont Books, 1969.
-The second example uses min-width and min-height on the targets (the linked numbers in the pagination menu) and not on the parent container, thereby meeting this target spacing Success Criterion and the AAA Success Criterion 2.5.5 Target Size.
-HarperCollins, 1800. Condition: Good.
-Real People Press, 1804. Shows some signs of wear, and may have some markings on the inside.
-1838. Condition: Very Good. Published by Belmont Books, 1969.
-This example relates to technique C42.
+ +This example relate to technique CXXXXXX.
+ + + + +