visibility: hidden
The CSS declaration that makes an element invisible while keeping it in the layout, so it still takes up its space.
In more detail
The element stays in the render tree and its box is still laid out, but nothing is painted for it. Use it when you want to hide something without the page shifting around.
Related terms
- display: none — The CSS declaration that removes an element and all its descendants from the render tree, so it takes no space and is not drawn.
- render tree — The tree of visible elements with their computed styles, built from the DOM and CSSOM, that the browser uses for layout and painting.
- layout — The rendering stage in which the browser calculates the exact position and size of every box on the page.
Taught in
- CSS Parsing, The CSSOM And The Render Tree — Frontend Architecture & Web Platform