Prop Style Alignself
# Style alignSelf Property
[ Style Object](#)
## Example
Center-align an item inside a flexible container:
document.getElementById("myDIV").style.alignSelf="center";
[Try it Yourself Β»](#)
* * *
## Definition and Usage
The alignSelf property specifies the alignment for the selected item inside the flexible container.
**Note:** The alignSelf property overrides the container's alignItems property.
* * *
## Browser Support

Firefox, Opera, and Chrome support the alignSelf property.
## Syntax
Get the alignSelf property:
_object_.style.alignSelf
Set the alignSelf property:
_object_.style.alignSelf="auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
## Property Values
| Value | Description |
| --- | --- |
| auto | Default value. The element inherits its parent container's align-items property. If it has no parent, it is set to "stretch". |
| stretch | The element is stretched 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. Read about _initial_. |
| inherit | Inherits this property from its parent element. Read about _inherit_. |
## Technical Details
| Default Value: | auto |
| --- |
| Return Value: | A String, representing the align-self property of an element. |
| CSS Version | CSS3 |
* * *
## Related Articles
CSS Reference: (#)
HTML DOM STYLE Reference: (#)
HTML DOM STYLE Reference: (#)
* * Style Object](#)
YouTip