Set the alignments for one of the items inside a flexible element to fit the container:
The alignSelf property specifies the alignment for the selected item inside the flexible container.
Note: The alignSelf property overrides the flexible container's alignItems property.
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by Webkit specify the first version that worked with a prefix.
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 7.0 Webkit | 12.1 |
Note: Safari support an alternative, the WebkitAlignSelf property.
Return the alignSelf property:
Set the alignSelf property:
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is positioned at the baseline of the container |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | auto |
---|---|
Return Value: | A String, representing the align-self property of an element |
CSS Version | CSS3 |
CSS reference: align-self property
HTML DOM STYLE Reference: alignContent property
HTML DOM STYLE Reference: alignItems property