Closed RolkerMan closed 3 years ago
@RolkerMan yes, you are right. To make them not create new stacking contexts, one way is to make sure all positioned elements are in the same level of nesting in the DOM. I changed the English version so that this is fixed:
https://wiki.developer.mozilla.org/en-US/docs/Web/CSS/z-index#Examples
What do you think? If you think this is good, can you please update the zh-CN version?
@chrisdavidmills I'd like to update the zh-CN version, but I couldn't see the changed content you mentioned in the Example section for the en version.
No worries. I've updated it myself.
Request type
Details
In the demo section,the z-index value of the green box doesn't seemed to be the reason why it's above the dashed-box.
It is more like that the z-index of dashed box is set to an integer, which establishes a local stacking context for the dashed box, as mentioned in the docs.
See the screenshot below for more information.
https://developer.mozilla.org/zh-CN/docs/Web/CSS/z-index