Don't Use CSS "display: none"
Two reasons to not use "display: none":
1. The screen readers will not access the hidden code.
2. The search bots will ignore it and its inner code.
You should use next code:
.hidden{
position: absolute;
width: 1px; /* Unaccessible if 0 /
height: 1px; / Unaccessible if 0 */
margin: -1px;
padding: 0;
border: 0;
clip: rect(0 0 0 0);
overflow: hidden;
}
Written by Antonio Vizuete
Related protips
2 Responses
How about attribute hidden?
over 1 year ago
·
Sometimes you want that to happen (alert boxes, prompts etc).
For SEO just use:
visibility: hidden;
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#