Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Flexbox

The place-self property

Reference for the CSS place-self shorthand: set align-self and justify-self together to position a single grid item inside its cell, with live examples.

The place-self property is a shorthand for align-self and justify-self. It positions one item inside its grid area on both axes with a single declaration, overriding the container's place-items.

One value applies to both axes. With two values, the first is the block-axis value (align-self) and the second the inline-axis value (justify-self).

CSS
.pin { place-self: end; }
.corner { place-self: start end; }

Try it

Positioning single items

Items with center, start end and end start shrink to their content and move inside their cells. The stretch item fills its whole cell, which is also what an unstyled grid item does.

Syntax

CSS
place-self: <'align-self'> <'justify-self'>?
  • Initial value: auto
  • Applies to: grid items, plus block-level and absolutely positioned boxes (where the longhands apply)
  • Inherited: no
  • Animatable: no
  • Computed value: as specified for the longhands

Values

Value Description
auto Uses the container's align-items / justify-items value.
stretch Fills the area on that axis unless a size is set.
start, end Pins the item to a start or end edge.
center Centers the item.
self-start, self-end Aligns by the item's own writing mode.
baseline Aligns baselines with other baseline-aligned items.
safe / unsafe Optional keyword before a position to control overflow.

Usage notes

  • Flex items. In flexbox only the align-self half has an effect; justify-self is ignored there. Use auto margins to push a flex item along the main axis.
  • Absolute positioning. With position: absolute inside a grid area, the values align the box within its containing area when top, right, bottom and left are left as auto.
  • Size matters. Non-stretch values make the item only as big as its content, so add width or height if you need a fixed size.
  • Order of values. Remember the order: block axis first (vertical in English), then inline axis (horizontal). start end means top right.

Browser support

Supported in all current browsers for grid items.