Why are there CSS rules using -9999px
I found the following CSS rules on Twitter:
.ProfileCanopy-headerBg img {
position: absolute;
left: 0;
right: 0;
top: -9999px;
bottom: -9999px;
margin: auto 0;
width: 100%;
}
What could be causing the -9999px limit?
+3
Trace
source
to share
1 answer
It's a way to hide an element, which still allows screen readers (and similar technologies) to read the content, as opposed to what you should be using, say display: none
.
The value is 9999px
arbitrary. Could be any negative number really, but I think it feels safer to really shove it far: P
+3
powerbuoy
source
to share