Correct option is C
The
z-index property in CSS controls the
stacking order of elements along the
z-axis (perpendicular to the screen). Elements with a higher z-index value are displayed in front of elements with a lower z-index value. This property is commonly used when dealing with overlapping elements to determine which element should appear on top.
Important Key Points:
1.
Stacking Context: The z-index property is effective only for elements with a defined position (relative, absolute, or fixed).
2.
Higher Values on Top: Elements with a higher z-index appear above those with a lower z-index.
3.
Default Value: The default z-index is 0, and elements with the same z-index follow the document's natural stacking order.
Knowledge Booster:
·
Horizontal Position: Controlled using properties like left or margin-left, not z-index.
·
Vertical Position: Adjusted using properties like top or margin-top.
·
Opacity: Managed by the opacity property, which sets the transparency of an element.
·
Font Size: Defined using the font-size property, unrelated to z-index.