--- url: "https://www.w3.org/WAI/WCAG22/Techniques/css/C7" titulek: "C7: Using CSS to hide a portion of the link text | WAI | W3C" h1: "Technique C7:Using CSS to hide a portion of the link text" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 05:33:30" znaku: 5061 slov: 744 kodovani: "utf-8" sha256: "418a1458f349e5173a18ba72a21501f826ccfe3c00b0858a3f7249fa88b12aa1" --- # Technique C7:Using CSS to hide a portion of the link text ## About this Technique This technique relates to: - [2.4.4 Link Purpose (In Context)](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context) ( **Sufficient** when used for providing a supplemental description of the purpose of a link) - [2.4.9 Link Purpose (Link Only)](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-link-only) ( **Sufficient** when used for providing a supplemental description of the purpose of a link) This technique applies to all technologies that support CSS. Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are **not required** to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about). ## Description The objective of this technique is to supplement the link text by adding additional text that describes the unique function of the link and styling the additional text so that it is not rendered on the screen by user agents that support CSS. When information in the surrounding context is needed to interpret the displayed link text, this technique provides a complete description of the link's input function while permitting the less complete text to be displayed. This technique works by creating a CSS selector to target text that is to be hidden. The rule set for the selector places the text to be hidden in a 1-pixel box with `overflow:hidden`. This ensures the text does not display on screen but remains accessible to assistive technologies such as screen readers and braille displays. Note that the technique does not use `visibility:hidden` or `display:none` properties, since these have the effect of hiding the text from assistive technology in addition to preventing on-screen display. This technique is **not** a method for hiding complete links, only a section of text within a link. The resources section includes methods for hiding and showing links aimed at screen reader users. Note This technique to hide link text has been advocated by some screen reader users and corporate web authors. It has proved effective on some websites. Other screen reader users and accessibility experts don't recommend this as a general technique because the results can be overly chatty and constrain the ability of the experienced screen reader user to control the verbosity. The working group believes the technique can be useful for web pages that do not have repetitive content in the hidden text areas. This technique can be used in combination with a style switching technique to present a page that is a [conforming alternate version](https://www.w3.org/TR/WCAG22/#dfn-conforming-alternate-versions) for non-conforming content. Refer to [C29](../css/C29) and [Understanding Conforming Alternate Versions](https://www.w3.org/WAI/WCAG22/Understanding/conformance#conforming-alt-versions) for more information. ## Examples The following examples use the CSS selector and rule set below: ``` .visually-hidden { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } ``` ### Example 1: A news site with "full story" links This example describes a news site that has a series of short synopsis of stories followed by a link that says "full story". Hidden link text describes the purpose of the link. ```
Washington has announced plans to stimulate economic growth. Washington stimulates economic growth Full Story
``` ### Example 2: A list of books in different formats This example describes a resource that has electronic books in different formats. The title of each book is followed by links that say "HTML" and "PDF." Visually-hidden text describes the purpose of each link. ```