I noticed on github that they use opacity of 0.0001, rather than 0, on certain elements they want to make transparent. Why is that?
The opacity property sets the opacity level for an element. The opacity-level describes the transparency-level, where 1 is not transparent at all, 0.5 is 50% see-through, and 0 is completely transparent.
Not sure what you mean by screen readers, but if you are worried about SEO then no, opacity will not affect SEO.
As you can see, whenever you need the element to disappear completely and not take up any space, you should use display: none; . If you want the element to have a transition or fade-in effect when becoming visible, you should use opacity: 0; .
If you set opacity to 0, it disappears from the page. But if you set opacity to 0.0001, it's still on the page (just "very hard to see") and it keep it's functionality (e.g. click etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With