CSS align-self property
Example
Center the alignments for one of the items inside a flexible element:
#myBlueDiv {
align-self: center;
}
align-self: center;
}
Definition and Usage
The align-self property specifies the alignment for the selected item inside the flexible container.
If the flex-container has align-items set to "center", the value will not be used on the flex-items with align-self set.
Note: The align-self property overrides the flexible container's align-items property.
| Default value: | auto |
|---|---|
| Inherited: | no |
| Animatable: | no. |
| Version: | CSS3 |
| JavaScript syntax: | object.style.alignSelf="center" |
- Inherited : "Inherited = no" means that it cannot takes (inherit) it's value from it's parent element.
- object - object in javascript means the element on which
align-selfis applied. - Animatable - "Animatable = no" means that it cannot be animated with CSS
@keyframes.
Browser Support
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 | |||||
|---|---|---|---|---|---|
| align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
CSS Syntax
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Property Values
| Value | Description | Play it |
|---|---|---|
| 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 container | |
| center | The element is positioned at the center of the container | |
| flex-start | The element is 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. | |
| inherit | Inherits this property from its parent element. |
Comments
Post a Comment