e01.org

Inset properties

In CSS, inset properties control positioned elements' location by specifying offsets from the elements' default positions. There are physical, logical, and shorthand inset properties.

In CSS, **inset properties** control positioned elements' location by specifying offsets from the elements' default positions. There are physical, logical, and shorthand inset properties.

The inset properties include the top, left, bottom, and right physical properties, their inset-block-start, inset-block-end, inset-inline-start, and inset-inline-end flow-relative logical property equivalents, and the inset-block, inset-inline, and inset shorthands.

**Physical properties** reference specific physical sides of an element. Logical properties use directional keywords relative to the block and inline axes. **Block axis** refers to the axis that defines the stacking order of elements in a block layout. The **inline axis** is perpendicular to the block axis, representing the direction along which inline content like text flows within a block. The mapping depends on the element's writing-mode, direction, and text-orientation.

The interpretation of inset properties depends on the value of the position property. When `position: absolute` is set, they represent insets from the [containing block](/docs/Web/CSS/Guides/Display/Containing_block) or [anchor element](/docs/Web/CSS/Guides/Anchor_positioning/Using). With `position: relative`, they represent insets from the box's default margin edge position. With `sticky`, they represent insets from the scroll container edge. The `fixed` value is similar to `absolute`, except the element is positioned and sized relative to its fixed positioning containing block, which is often the viewport.

## See also

- [Layout and the containing block](/docs/Web/CSS/Guides/Display/Containing_block)
- [CSS positioned layout](/docs/Web/CSS/Guides/Positioned_layout) module
- [CSS logical properties and values](/docs/Web/CSS/Guides/Logical_properties_and_values) module
- [CSS anchor positioning](/docs/Web/CSS/Guides/Anchor_positioning) module

source: MDN Web Docs mirror · page

Cite this

"Inset properties". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Glossary/Inset_properties

JSON record · API collection · citation policy