3 ms·
All of this is defined in the spec. display:contents just means that in the box tree the box is elided and its child boxes are placed where it used to be, and
by bzbarsky 12y ago
All of this is defined in the spec. display:contents just means that in the box tree the box is elided and its child boxes are placed where it used to be, and then things proceed as normal.
If you have nested display:contents things, it just works: you end up with a box and what used to be its great-nephews/nieces in the same flat list is all.
- taeric 12y agoMy point is really that I am not even sure what I would expect to happen in such cases. To the point that I will find it hardly surprising when developers on a browser inevitably makes a mistake in implementation. So, yes, this may all be there in the spec. But this is really just making the spec larger and larger with what seems to be nominal, if not decreasing, gains.
- bzbarsky 12y ago> My point is really that I am not even sure what I would > expect to happen in such cases. The same thing as happens if you just delete the parent element from the source (if we ignore for the moment selector matching and inheritance). > with what seems to be nominal, if not decreasing, gains. display:contents was pretty commonly requested by component authors who want their component to fit into a larger layout framework (flex, grid, table) as more than one layout unit. I agree that if you're not trying to author components it's of pretty limited utility.