A new and more friendly introduction to CSS hidden text methods, explains why the existing several CSS hidden text methods are flawed and how the new methods can be compensated. It is generally practical, but this method is quite novel.
1. display: none;
The search engine may consider the hidden text to be spam and ignored.
Screen readers (programs designed to read screen content for visually impaired people) will ignore hidden text. 2. visibility: hidden;
We should be familiar with this, that is, the hidden content occupies the physical space that it should occupy.
3. overflow: hidden; a reasonable method
The code is as follows: |
Copy code |
. Texthidden { Display: block;/* unified conversion to block-level elements */ Overflow: hidden; Width: 0; Height: 0; }
|
As shown in the preceding section of CSS, setting the width and height to 0, and hiding more than half will make up for the defects in the first and second methods, it also achieves the purpose of hiding content.
Terms:
Accessibility)
Is a practice that makes it easier for people with disabilities to use applications.
The American Disabilities Act, dated 1990)
The Telecommunications Act of 1996)
Rehabilitation Act Amendment (Rehabilitation Act Amendments) 508 clause
Web Accessibility Initiative (WAI ))
These are accessible standards. For more information, see the Law and disabilities page.
Screen Reader)
It is a program designed to read screen content for visually impaired people.
Availability)
The convention that makes it easier for everyone to use applications. Accessibility is a type of availability.
Web Browser)
Displays any program on the Web page. Most Web browsers can display HTML pages, but some (such as browsers on mobile phones) may only display other types of pages, such as WML or cHTML.