Closed
Description
display: contents
replaces an element by its children, so I wonder if the children should still inherit from that element.
I think it would make more sense if they didn't (except maybe for the display
property itself?). But on Firefox and Chrome, the inheritance is not affected.
Example (https://jsfiddle.net/xyeL8ewr/):
<div>
<p>
<span>Foo</span>
</p>
<span>Bar</span>
</div>
div {
color: blue;
}
p {
display: contents;
color: red;
}
"Foo" is red and "Bar" is blue. But with display: contents
, it's like if the markup was
<div>
<span>Foo</span>
<span>Bar</span>
</div>
so maybe both should be blue.