What does [display: contents;] mean?

I just read this:
This is an experimental API that should not be used in production code.

And found info on it here:
https://samrueby.com/2015/02/09/firefox-is-releasing-support-for-css-display-contents/

What is this display property, and when should it be used?

[display: contents;]

1 Like

According to the page you linked to it is an experimental value for defining that the elements will be replaced by their pseudo-box and their child boxes.

New. Still being considered. I don’t quite understand whow it will be used.

https://drafts.csswg.org/css-display/

It will be used to ignore a grouping element. Only the children within that grouping element will be considered instead.

In effect it’s like none, but only for that one element. None and contents differ only by how their children are affected. None doesn’t display the element as well as none of its children. Contents however just doesn’t display the element, with the children being unaffected.

5 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.