YouTip LogoYouTip

Prop Style Alignitems

# Style alignItems Property [![Image 8: Style Object Reference](#) Style Object](#) ## Example Center-align the items in a flexible
element: document.getElementById("myDIV").style.alignItems="center"; [Try it Yourself Β»](#) * * * ## Definition and Usage The alignItems property specifies the default alignment for items inside a flexible container. **Tip:** Use the align-self property of each item to override the align-items implementation. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) IE11, Firefox, Chrome, and Opera support the alignItems property. Safari, IE 9 and earlier versions do not support the alignItems property. IE 10 requires the prefix -ms-. ## Syntax Get the alignItems property: _object_.style.alignItems Set the alignItems property: _object_.style.alignItems="stretch|center|flex-start|flex-end|baseline|initial|inherit" ## Property Values | Value | Description | | --- | --- | | stretch | Default value. Items are stretched to fit the container. | | center | Items are centered in the container. | | flex-start | Items are placed at the beginning of the container. | | flex-end | Items are placed at the end of the container. | | baseline | Items are aligned to the baseline of the container. | | initial | Sets this property to its default value. See (#). | | inherit | Inherits this property from its parent element. See (#). | ## Technical Details | Default value: | stretch | | --- | | Return value: | A String, representing the align-items property of an element. | | CSS Version | CSS3 | * * * ## Related Articles CSS Reference: (#) HTML DOM STYLE Reference: (#) HTML DOM STYLE Reference: (#) * * Style Object](#)
← Prop Style AlignselfProp Style Aligncontent β†’