mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

https://developer.mozilla.org/zh-CN/docs/Web/CSS/z-index #3891

Closed RolkerMan closed 3 years ago

RolkerMan commented 3 years ago

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. MDN 文档bug

https://developer.mozilla.org/zh-CN/docs/Web/CSS/z-index

chrisdavidmills commented 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?

RolkerMan commented 3 years ago

@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.

chrisdavidmills commented 3 years ago

No worries. I've updated it myself.