X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Style alignSelf Property

Style Object Reference Style Object

Example

Center the alignments for one of the items inside a flexible element:

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 flexible container's alignItems property.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The alignSelf property is supported in IE11, Firefox, Opera, and Chrome.

The alignSelf property is not supported in Internet Explorer 10 and earlier versions, or Safari.


Syntax

Return 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. 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

Technical Details

Default Value: auto
Return Value: A String, representing the align-self property of an element
CSS Version CSS3


Related Pages

CSS reference: align-self property

HTML DOM STYLE Reference: alignContent property

HTML DOM STYLE Reference: alignItems property


Style Object Reference Style Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook