seniorCSS

What is the CSS display: contents property?

Updated Apr 28, 2026

Short answer

It removes the element from the layout hierarchy, making its children act as direct children of the element's parent.

Deep explanation

The element's box simply vanishes, but its children remain. This is incredibly useful for structural HTML wrappers (like a semantic <article> tag) that you want to participate in a parent's Flexbox or Grid without creating an interrupting container block.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More CSS interview questions

View all →