Home·CSS properties

inset

Positioning

Sets all four offsets at once; 0 stretches the element over its parent.

How to write itinset: auto;
Common valuesauto, 0
InheritedNo — it stops at this element
Sets all oftop, right, bottom, left
CategoryPositioning

How to read this

  • An inherited property only needs writing once on the parent — every child picks it up. Most text properties work this way.
  • A shorthand resets whatever you leave out. Writing background: red alone also wipes a background image you set earlier.
  • When rules collide, the more specific selector wins; only when specificity ties does source order decide.
  • Animate transform and opacity for smoothness. Changing width or top forces the layout to be recalculated.

Frequently asked questions

Q. What is the CSS inset property?

Sets all four offsets at once; 0 stretches the element over its parent.

Q. How do you write inset?

As inset: auto; Common values include auto, 0.

Q. Is inset inherited?

No. It applies only where you write it, so each element needs its own declaration.

Q. What does the inset shorthand set?

top, right, bottom, left — and anything you leave out resets to its default.

Properties in the same group

Reference docs