HTML & CSS · Senior · Question 62 of 75
Why add isolation: isolate to a component root?
- ✓Correct answer: To create a stacking context so the component's internal
z-indexvalues can't leak out and clash with the page - 2To prevent JavaScript from modifying the component
- 3To isolate its styles like Shadow DOM
Explanation
It creates a stacking context without side effects like position or transform. Internal z-index: 10 then only competes with siblings inside the component.