CSS align-items Property






<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->




CSS align-items Property



Previous
Complete CSS Reference
Next



Example


Center the alignments for all the items of the flexible <div> element:



div
{
    display: -webkit-flex; /* Safari */
    -webkit-align-items: center; /* Safari 7.0+ */
   
display: flex;
    align-items: center;
}

Try it Yourself »



Definition and Usage



The align-items property specifies the default alignment for items inside the flexible container.



Tip: Use the align-self property of each item to override the align-items property.

























Default value: stretch
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax:
object.style.alignItems="center"
Try it




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-items 21.0 11.0 20.0 9.0
7.0 -webkit-
12.1







<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]
-->





CSS Syntax



align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;


Property Values












































Value Description Play it
stretch Default. Items are stretched to fit the container Play it »
center Items are positioned at the center of the container Play it »
flex-start Items are positioned at the beginning of the container Play it »
flex-end Items are positioned at the end of the container Play it »
baseline Items are positioned at the baseline of the container Play it »
initial Sets this property to its default value. Read about initial
Play it »
inherit Inherits this property from its parent element. Read about inherit




Related Pages


CSS Reference: align-content property


CSS Reference: align-self property


HTML DOM reference: alignItems property





Previous
Complete CSS Reference
Next

Popular posts from this blog

Chat program with C++ and SFML

Function to Return a JSON Like Objects Using VBA Collections and Arrays

Will my employers contract hold up in court?