Skip to content

Laboratory · CSS Lab

What actually creates a stacking context?

Briefing

Most developers can name two: position with z-index, and opacity. The real list is much longer, and several entries look completely harmless.

A field guide to the twenty-odd declarations that quietly reorganise your paint order.

Laboratory
CSS Lab
Level
ENGINEER
Estimated time
7 minutes
Method
interactive
Variables under observation
stacking contextcompositingcontainmentwill-change