What is the CSS "stacking context" and how is a new one created?
Correct! Well done.
Incorrect.
The correct answer is B) A stacking context groups elements along the z-axis where z-index values are only compared within that context; new stacking contexts are created by properties like positioned z-index, opacity less than 1, and transform
Correct Answer
A stacking context groups elements along the z-axis where z-index values are only compared within that context; new stacking contexts are created by properties like positioned z-index, opacity less than 1, and transform
z-index values only have meaning relative to siblings within the same stacking context; certain CSS properties (positioned elements with z-index, opacity, transform, filter, will-change, etc.) establish new stacking contexts, which can cause unexpected layering when nested.