in MDN web docs it is mentioned that stacking context is formed in these scenarios:
- Element with a opacity value less than 1
- Element with a
will-change
value specifying any property that would create a stacking context on non-initial value
but when I set will-change
to opacity
(non-initial value of less than 1) the stacking doesn't work as expected (blue div below red one), see this fiddle
some other scenarios works as expected like; blue div above red one (links to fiddles)
- Element with a position value absolute or relative and z-index value other than auto
- Element that is a child of a grid container, with z-index value other than auto
what am I doing wrong, and is there any other way to make stacking context works as expected
I'm asking because sometime I can't change the position to relative as this will affect the absolute children of that element