Advanced HTML & CSS
Q81 / 100

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

B

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

Explanation

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.

Progress
81/100