What is the primary consequence of setting the ‘display’ property to ‘contents’ on a container element?

Web Development Hard

Web Development — Hard

What is the primary consequence of setting the ‘display’ property to ‘contents’ on a container element?

Key points

  • The element itself generates no box.
  • Children are promoted to the parent's layout context.
  • Accessibility tree may be affected by the removal of the container.
  • Does not affect the visibility of child elements.

Ready to go further?

Related questions