Skip to content

Z-Index

Controls the element's stack order.

Utility Properties
Error: 429

This example showcases various z-index utilities:

  • The zi-10 z index utility sets the z-index to 10, positioning the element above elements with a lower z-index value.
  • The zi-20 z index utility sets the z-index to 20, positioning the element even higher in the stacking context.

A

B

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

Conditional styles

Learn how to override existing utilities based on the userโ€™s screen size or other factors, such as hover states.

Media modifier

You can combine responsive breakpoints like sm:-*,md:-*, lg:-*, and xxl:-* allows targeting specific utilities in different viewports.

<div class="zi-10 md:zi-20 ..."></div>

Hover modifier

Alternatively, you can apply :hover by using h:-* utility to override elements and change their values when hovering over them.

<div class="zi-10 h:zi-20 ..."></div>