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 pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro