When is it better to use visibility: hidden?

That is what I took from it as well.

you can use for modal pusposes.

That said, neither option is accessible to most screen readers

Can’t media queries be used to prevent screen readers from reading certain pieces of text on a web page?

Possibly yes, but the bigger question is, why hide text from a screen reader? Search engines frown on that sort thing.

1 Like

But why not use “comments” then? Using the “visibility: hidden” property for essentially debugging unresolved code is akin to “commenting” out that code for further resolution/debugging. Using “comments” here, in a way, undermines this supposed “best use” of the “visibility: hidden” property. I guess one could use either for these purposes.