arrow
arrow
arrow
Which of the following best describes the function of the z-index property in CSS?
Question



Which of the following best describes the function of the z-index property in CSS?

A.

It determines the horizontal position of an element.

B.

It specifies the vertical position of an element.

C.

It controls the stacking order of elements along the z-axis.

D.

It adjusts the opacity of an element.

E.

It sets the font size of an element.

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.

Free Tests

Free
Must Attempt
Video Solutions

RBI Assistant Pre 2026 Full Mock Test -01

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Asst Prelims 2026 : Reasoning Section Test 01

languageIcon English
  • pdpQsnIcon35 Questions
  • pdpsheetsIcon35 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Office Attendant 2026 Full Mock Test - 01

languageIcon English
  • pdpQsnIcon120 Questions
  • pdpsheetsIcon120 Marks
  • timerIcon90 Mins
languageIcon English
test-prime-package

Access ‘IBPS SO IT Officer’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow