3 ms·
I imagine you can use it to ensure that elements that are added simply for semantic purposes (like, say, containers for other elements that are there just to gr
by dguaraglia 12y ago
I imagine you can use it to ensure that elements that are added simply for semantic purposes (like, say, containers for other elements that are there just to group them logically) do not create any boxing side effects, like default padding and similar non-obvious CSS buggery.
- taeric 12y agoI fear that now we will just replace it with another set of non-obvious CSS behavior. Consider, does this property nest well? How does absolute positioning work against something like this? Do they just ignore the parent box, since they are replacing it? Undefined or Browser specific. Or just a further explosion of the spec?
- bzbarsky 12y agoAll 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.
- acdha 12y agoPossibly spec explosion but it is there: http://dev.w3.org/csswg/css-display/#the-display-outside http://dev.w3.org/csswg/css-display/#the-display-outside