What are some example use-cases for visibility:hidden? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What are some example use-cases for visibility:hidden?

My first thought is to hide a caption informing that required information has not been filled in on a form. Is that a valid use-case?

26th Feb 2017, 9:59 PM
Tuck
Tuck - avatar
2 Answers
+ 9
Absolutely, and it wouldn't mess with other elements adjacent. If you had used "visibilty: none" anything around the element would start looking funny, as the space would no longer be preserved. Hidden keeps the space there, as in the area is transparent without the element visible to the eye. I hope that made sense lool.
26th Feb 2017, 10:17 PM
Mark Foxx
Mark Foxx - avatar
0
Totally made sense, thank you!
26th Feb 2017, 10:19 PM
Tuck
Tuck - avatar