HTML & CSS · Senior · Question 26 of 75
What creates a new stacking context even without position and z-index?
- ✓Correct answer:
opacitybelow 1,transform,filter,isolation: isolate - 2Any element with
display: blockordisplay: flex - 3Non-zero
marginorpadding, and alsoborder
Explanation
A stacking context is created by: the root element, positioned elements with z-index, flex/grid items with z-index, opacity < 1, transform, filter, perspective, mix-blend-mode, isolation: isolate, contain: paint, and will-change with such properties. isolation: isolate is the "cleanest" way to create one without side effects.