Description
CSS Color Level 3 defines:
https://drafts.csswg.org/css-color-3/#transparency
If an element with
opacity
less than 1 is not positioned, then it is painted on the same layer, within its parent stacking context, as positioned elements with stack level 0.
However this sentence was apparently removed from Level 4: https://drafts.csswg.org/css-color/#transparency
I think this removal is a bug and that definition is necessary, because CSS 2 appendix E is written with the assumption that elements that create a stacking context are all positioned. (This is because only the z-index
property creates a stacking context in CSS 2, and it only applies to positioned elements.)
css-transforms has an alternative wording that also works:
https://drafts.csswg.org/css-transforms-1/#transform-rendering
For elements whose layout is governed by the CSS box model, any value other than
none
for thetransform
property results in the creation of a stacking context. Implementations must paint the layer it creates, within its parent stacking context, at the same stacking order that would be used if it were a positioned element withz-index: 0
.