Which CSS property, when set to 'none', removes an element from the document flow?

The story behind the answer

The CSS property that removes an element from the document flow when set to `none` is `display`.

For example, `display: none` prevents the element from being rendered and removes its box from layout, so surrounding content acts as though the element were not there. Its descendants are not displayed either, although the element remains present in the HTML and can be shown again by changing its style.

This differs from `visibility: hidden`, which hides an element while normally preserving its layout space. `opacity: 0` also leaves the element in the layout and may leave it interactive. `position: absolute` or `fixed` removes an element from normal flow, but those are positioning modes rather than the direct “none” value that suppresses display. The `display` property is therefore the single canonical answer.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: