What is the clean CSS approach to solve A dropdown is hidden behind another positioned section. in a modal dialog?

CSS Published Updated 0 Views Verified
Problem: A dropdown is hidden behind another positioned section. Context: This CSS troubleshooting question uses a modal dialog example. Correct approach: Give the dropdown a stacking context/position and a suitable z-index, while checking ancestor stacking contexts. Working CSS: .dropdown { position:relative; z-index:1000; }
Looking for the latest Sarkari Result 2026 updates? Check the latest government exam results, merit lists and result updates on Sarkari Resultess.
Sarkari Resultess
Questions & Answers

Answer & Explanation

4 Answers
Verified

A. Common but incorrect approach

Use z-index:-1 on the dropdown
Additional Explanation
This approach does not directly implement the required CSS behavior.
Sarkari Resultess
Editorial Answer 1
Verified Correct Answer

B. Correct CSS solution

.dropdown { position:relative; z-index:1000; }
Additional Explanation
Give the dropdown a stacking context/position and a suitable z-index, while checking ancestor stacking contexts.
Sarkari Resultess
Editorial Answer 2
Verified

C. Incorrect CSS alternative

Use font-weight:9999
Additional Explanation
This is not a valid CSS property or does not solve the stated problem.
Sarkari Resultess
Editorial Answer 3
Verified

D. Another incorrect approach

Use opacity:2
Additional Explanation
This does not address the underlying CSS layout or styling issue.
Sarkari Resultess
Editorial Answer 4