← TechnologyThe essentials of

display: contents removes the box, not the HTML element

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

Children can participate in the arrangement without their own box on the wrapper.

Useful to know

display: contents allows children to shape themselves as if the enveloping element does not have its own box. The node itself remains in DOM; the inheritance rules and the selectors do not disappear. [1]

In a grid layout, this can bring out grandchildren as participants in the network. However, the frame and the background of the shell no longer have the usual drawing box. MDN also notes accessibility tree issues in some implementations. Try semantics with relevant browsers and assistive technologies, especially in tables, lists, and interactive groups.

Sources

For further detail and to check the information:

  1. [1] MDN — display ↗