CSS align-self Property
Description
The align-self CSS property allows you to override how an individual item is aligned inside a flex or grid container, independently of the other items. While layout alignment is often controlled at the container level, align-self gives you fine-grained control over a single element’s position along the cross axis. This makes it especially useful when one item needs to visually stand out, sit higher or lower, or behave differently from its siblings without changing the overall layout structure.
In a flex layout, align-self works in relation to the container’s alignment rules, typically defined by align-items. When applied, it overrides the container’s alignment setting for that specific element only. This is helpful in responsive designs where most elements follow a consistent pattern, but one item - such as a button, icon, or label - needs a custom alignment. In grid layouts, align-self controls how an item aligns within its own grid area, giving you precise control without affecting other grid items.
The behavior of align-self also depends on the layout direction defined by the container. For example, when used in a flex container that flows in a column direction (controlled by flex-direction), the cross axis changes, and so does the visual effect of alignment. This adaptability makes align-self a powerful tool for building flexible and responsive interfaces. It pairs especially well with modern layout techniques, allowing developers to create polished designs without resorting to extra wrappers or complex positioning logic.
Definition
- Initial value
- auto
- Applies to
- Flex items, grid items, and absolutely-positioned boxes
- Inherited
- No
- Computed value
- Specified value
- Animatable
- yes
- JavaScript syntax
- object.style.alignSelf
Interactive Demo
Syntax
align-self: auto | flex-start | flex-end | center | baseline | stretch
Values
- autoTakes the parent value of align-items or stretch if there is no parent.
- flex-startThe element is aligned at the beginning of the transverse axis of the container.
- flex-endThe element is aligned at the end of the transverse axis of the container.
- centerThe element is aligned in the center line on the transverse axis.
- baselineThe element is aligned with the baseline of the text.
- stretchThe element is stretched in such a way as to occupy the entire free space of the container along the transverse axis.
Example
Browser Support
The following information will show you the current browser support for the CSS align-self property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
