Z-Index

Set the stack order for an element.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari

Usage

A
B
<div class="p-r">
<div class="d-f p-r zi-10 ai-c jc-c w-30 h-30 bg-indigo">
<div class="c-white">A</div>
</div>
<div class="d-f l-0 p-a t-0 zi-20 ai-c jc-c w-15 h-15 bg-indigo-8">
<div class="c-white">B</div>
</div>
</div>

Responsiveness

Use breakpoint prefixes to target different screen sizes. Styles apply from the breakpoint & up.

Target viewport sizes with breakpoint prefixes.

sm:zi-*
Small640px
md:zi-*
Medium768px
lg:zi-*
Large1024px
xxl:zi-*
Extra Large1536px

Hover State

Apply styles conditionally on hover using the h: prefix.

Add the h: prefix to apply styles only when the user hovers over the element.

Syntax:h:zi-*

Negative Values

Use negative variants to apply negative z-index values.

Use the -- syntax to apply negative numeric values.

Syntax:zi--*