inset

A modern shorthand property that sets the distance between an element and its parent container. It's much faster than writing out 'top', 'right', 'bottom', and 'left' separately.

It is documented as part of the CSS Logical Properties and Values, CSS Positioned Layout specification.

/* Usage Example */
.full-screen-overlay {
  position: fixed;
  inset: 0;
  /* stretches the element to fill the entire screen */
}

/* Syntax */
inset: top;

/* Global values */
inset: inherit;
inset: initial;
inset: revert;
inset: revert-layer;
inset: unset;

This comparison shows how inset works in a real project. View snippet →

Widely available Since 2021 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2021.

87+
66+
14.1+
87+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC