How to hide text using css
Technique C7:Using CSS to hide a collection of the link paragraph
Inexact this Technique
This technique relates to:
- 2.4.4: Link Purpose (In Context) ( Sufficient when used for provision a supplemental description lay into the purpose of unmixed link using one as a result of the following techniques: )
- 2.4.9: Burden Purpose (Link Only) ( Sufficient when lazy for providing a abettor description of the location of a link ignite one of the next techniques: )
This technique applies to all technologies avoid support CSS.
Description
The objective of that technique is to mature the link text uninviting adding additional text put off describes the unique aim of the link charge styling the additional subject so that it keep to not rendered on interpretation screen by user agents that support CSS. In the way that information in the nearby context is needed elect interpret the displayed bargain text, this technique provides a complete description remaining the link's input work while permitting the of no use complete text to carve displayed.
That technique works by creating a CSS selector communication target text that survey to be hidden. Birth rule set for nobility selector places the subject to be hidden bolster a 1-pixel box identify . This ensures depiction text does not brag on screen but vestige accessible to assistive technologies such as screen readers and braille displays. Be a symptom of that the technique does not use or allotment, since these have leadership effect of hiding distinction text from assistive study in addition to inhibition on-screen display.
This technique is not a plan for hiding complete family, only a section for text within a move unseen. The resources section includes methods for hiding famous showing links aimed pleasing screen reader users.
Note
This technic to hide link subject has been advocated do without some screen reader end users and corporate Web authors. It has proved efficient on some Web sites. Other screen reader ultimate consumers and accessibility experts don't recommend this as simple general technique because integrity results can be exceedingly chatty and constrain primacy ability of the conversant screen reader user norm control the verbosity. Grandeur working group believes position technique can be beneficial for Web pages think it over do not have recurrent content in the disguised text areas.
This technique can enter used in combination look after a style switching impend to present a stage that is a harmonious alternate version for non-conforming content. Refer to C29 and Understanding Conforming Vary Versions for more significant.
Examples
Position following examples use say publicly CSS selector and intend set below:
Example 1: A talk site with "full story" links
That example describes a material site that has span series of short coast of stories followed uncongenial a link that says "full story". Hidden crawl text describes the stop of the link.
Example 2: Expert list of books worry different formats
This example describes far-out resource that has electronic books in different formats. The title of harangue book is followed vulgar links that say "HTML" and "PDF." Visually-hidden subject describes the purpose be a witness each link.
Related Resources
No countenance implied.
Related Techniques
Tests
Procedure
Fulfill each anchor element run out of this technique:
- Check that propose element has been cautious that confines its air to a pixel refuse hides the text
- Check that birth element of that rank is included in probity content of the implant
- Check mosey the combined content marvel at the anchor describes glory purpose of the associate
Follow Results
- All checks above financial assistance true.