CSS align-self property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS align-self property aligns an element vertically (along cross/block/column axis) within its container by adjusting the margins.
We are using a flex container as an example.
Syntax
align-self : auto | baseline | center | stretch | flex-start | flex-end
Property values
autoDefault
-
It stretches out the element vertically to fill the height of container completely.
- Try it
align-self: auto; stretch
-
It stretches the element so as fill the height of the container completely.
- Try it
align-self: stretch; flex-start
-
flex-start aligns the current element at the start of flex container.
- Try it
align-self: flex-start; flex-end
-
flex-end aligns the current element at the end of the flex container.
- Try it
align-self: flex-end;
Applicable to
It applies to flex items, grid items, and absolutely positioned elements.