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.

Quick example

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

Quick facts

Initial value
See individual properties
Inherited
No
Applies to
positioned elements
Animation type
lpc

Values

top

inset Browser Support

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.

Safe to use without fallbacks.

87+
66+
14.1+
87+
ESC