Are elements with the css property of visibility:hidden
still present in the HTML DOM tree?
Asked
Active
Viewed 384 times
-1

Heisenberg
- 475
- 8
- 24
-
do you mean by default, no child tags in the body? – s.kuznetsov Nov 25 '20 at 10:54
-
@sergeykuznetsov by default – Heisenberg Nov 25 '20 at 10:55
-
This might be helpful. https://stackoverflow.com/questions/4718342/lots-of-dom-hidden-vs-display-none – Debsmita Paul Nov 25 '20 at 10:55
-
@DebsmitaPaul Thanks, I've already read that question but wasn't able to get a clear answer. I'm pretty sure that the elements with `visibility:hidden` is still present in the DOM, I just needed to confirm this – Heisenberg Nov 25 '20 at 10:57
-
Just because an element has some style doesn't mean it disappears from the page. Even elements with `display: none` still appear on the page. (citation: a project involving a popup with display none= – Nov 25 '20 at 10:59
-
1Why not just test this for yourself using the browser's developer tools? – phuzi Nov 25 '20 at 11:01
1 Answers
3
Yes, for sure. The CSS is only applying styles to your HTML-DOM Elements. You can change the behaviour and even make it completly ivisible but the element still exists.

J. Doe
- 837
- 1
- 7
- 18