Parent stacking context not working?
See original GitHub issueE.g. https://output.jsbin.com/zovecuzoce/1
<div class="absolute">
<div class="relative">
<div class="child">foo</div>
</div>
</div>
.absolute {
position: absolute;
}
.relative {
position: relative;
}
When selecting .relative
:
Expected parent stacking context: .absolute
When selecting .child
:
Expected parent stacking context: .relative
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to deal with stacking context problem [duplicate]
To put the child behind its parent, let its z-index work relative to the document (or some other common ancestor that's further up...
Read more >4 reasons your z-index isn't working (and how to fix it)
Solution: Move the modal outside of the content parent, and into the main stacking context of the page. The corrected markup would then...
Read more >The stacking context - CSS: Cascading Style Sheets | MDN
The stacking context is a three-dimensional conceptualization of HTML elements along an imaginary z-axis relative to the user, ...
Read more >Fixes for CSS z-index not working - Weekend Projects
Check properties that enable stacking context is used, such as opacity, mix-blend-mode, will-change; Verify that the parent element is not restricting the child ......
Read more >Z-index and stacking contexts - web.dev
In normal flow, if you set a specific value for z-index and it isn't working, you need to set the element's position value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A made a separate Chrome extension for this: https://twitter.com/OliverJAsh/status/1268821858842968065
Glad you find a solution! I’ll close this one out, but will document the
current
feedback in #20.