CSS Align-items Properties

Source: Internet
Author: User

Align the <div> elements of the elastic box in the center:

1 <style>2 #main{3 width:220px;4 Height:300px;5 Border:1px solid Black;6 Display:-webkit-flex; /*Safari*/7 -webkit-align-items:Center; /*Safari 7.0+*/8 Display:Flex;9 Align-items:Center;Ten } One  A #main Div{ - -webkit-flex:1; /*Safari 6.1+*/ - Flex:1; the } - </style> - </Head> - <Body> +  - <DivID= "Main"> +   <Divstyle= "background-color:coral;">RED</Div> A   <Divstyle= "Background-color:lightblue;">BLUE</Div> at   <Divstyle= "Background-color:lightgreen;">Green div with more content.</Div> - </Div> -  - <P><b>Attention:</b>Internet Explorer 10 and earlier browsers do not support the Align-items property.</P> - <P><b>Attention:</b>This property is supported by the-webkit-align-items property in Safari 7.0 and later.</P> -  in </Body>

Operation Result:

Property value

CSS syntax

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

CSS Align-items Properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.