Tailwind Class Sorter
Sort Tailwind classes and detect conflicting utilities with a winner explanation.
OpenWrite a positioned layer rule quickly, and understand why z-index sometimes seems to do nothing.
Select relative, absolute, fixed or sticky.
Type the stacking value for this layer.
Edit top and left in the copied rule to place the element.
Copy the .layer CSS or download position.css.
A dropdown keeps opening underneath the sticky header no matter how high you set its z-index. Before raising it to 99999, it helps to get the basics right: which position mode the element uses and which stacking context it lives in. This tool writes the starting rule.
Pick a position mode (relative, absolute, fixed or sticky) and type a z-index. The output is a .layer rule with those two values plus top: 0 and left: 0, which you can adjust. It is a starter snippet rather than a visual layering simulator, so the value of the page is in getting the combination right.
The most common z-index mistake is not the number at all. z-index only competes within the same stacking context, and a parent creates a new one when it has, for example, a transform, opacity below 1, a filter, or position with a z-index of its own. A child with z-index 9999 inside such a parent can still sit below a sibling of that parent with z-index 2. Find the nearest ancestor that creates a context and set the z-index there. Also remember that sticky needs a top (or bottom) value and an ancestor that scrolls, and that a filter or transform on an ancestor changes what fixed elements are positioned against. To center a positioned box's content, the flexbox CSS builder helps, and the CSS snippets collection has a visually hidden utility built on absolute positioning.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
It needs a positioned element (anything but static) or a flex or grid item. If it already has one, a parent is probably creating a separate stacking context that limits it.
Sticky needs an offset such as top: 0, and it stops at the edge of its parent. An ancestor with overflow: hidden or auto also changes which container it sticks within.
Absolute is placed relative to the nearest positioned ancestor and scrolls with the page. Fixed is placed relative to the viewport and stays put while scrolling, unless an ancestor has a transform or filter.