Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. align-self

align-self

Specifies the cross-axis alignment for individual flex items. Can override the container's 'align-items' value.

Sample Code

style.css
/* Follow the container's align-items (default) */
.item { align-self: auto;}

/* Center this item only */
.item-center { align-self: center;}

/* Align this item to the bottom only */
.item-end { align-self: flex-end;}

/* Stretch this item only */
.item-stretch { align-self: stretch;}

Available Values

ValueDescription
autoUses the container's 'align-items' value. This is the initial value.
flex-startAligns the item to the start of the cross axis.
flex-endAligns the item to the end of the cross axis.
centerCenters the item along the cross axis.
baselineAligns the item to the text baseline within the item.
stretchStretches the item to fill the cross axis.

Specification

PropertyDetails
Initial Valueauto
Applies toFlex items
InheritedNo
AnimationNot animatable (discrete)

Browser Support

Chrome Chrome
29 +
28
27
26
25
24
23
22
21
↑ Requires prefix '-webkit-'
20 and earlier ×
Firefox Firefox
20 +
19 and earlier ×
Safari Safari
9 +
8
7
↑ Requires prefix '-webkit-'
6 and earlier ×
Edge Edge
12 +
IE IE
11
10
9 ×
8 ×
7 ×
6 ×
Opera Opera
12.1 +
11 and earlier ×
iOS Safari iOS Safari
9 +
8
7
↑ Requires prefix '-webkit-'
6 and earlier ×
Android Android Browser
4.4 +
3 and earlier ×
Chrome Android Chrome Android
Latest
Same support as desktop version
Firefox Android Firefox Android
Latest
Same support as desktop version

* Version information is based on MDN / Can I Use .

Description

'align-self' is a property specified on individual flex items that lets you override the container's 'align-items' value for that item alone. Use it when you want something like "align everything to the top, but center just this one item".

Relationship with align-items

align-items: flex-start (all aligned to top) A (top-aligned) B (centered) align-self: center C (bottom-aligned) align-self: flex-end

'align-items' is a property specified on the container that sets the alignment for all items at once. 'align-self' is a property specified on individual items to override that setting. When 'align-self: auto' (the initial value) is set, the container's 'align-items' value is applied as-is.

.container {
    display: flex;
    align-items: flex-start;  /* All items align to top */
    height: 200px;
}
.item-a { /* align-self: auto -> flex-start is applied */ }
.item-b { align-self: center;}    /* Only this item is centered */
.item-c { align-self: flex-end;}  /* Only this item aligns to bottom */

Pattern: Pin Footer to Bottom

flex-direction: column Card body flex: 1 Footer (pinned to bottom) ← align-self: flex-end

/* Pin only the footer to the bottom within a card */
.card {
    display: flex;
    flex-direction: column;
    height: 300px;
}
.card-body { flex: 1;}
.card-footer {
    align-self: flex-end;  /* Place at the end of the cross axis (horizontal) */
}

Related Properties

PropertyDescription
align-itemsSets the cross-axis alignment for all items in the container at once. 'align-self' overrides this value on a per-item basis.
justify-contentControls alignment along the main axis. There is no standard property to override the main-axis alignment for individual items ('margin: auto' can be used as a workaround).

If you find any errors or copyright issues, please .