CSS3.0 Box Model: Display:-webkit-box

Source: Internet
Author: User

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4   <title>CSS3 Box Model</title>  5   <style>6 . Box3{7 width:300px;8 Height:100px;9     /*set the parent class of the CSS3 box model*/Ten Display:-webkit-box; One Display:-moz-box; A Display:Box; -  - Background-color:#1d89cf; the   } - . Box3>section{ -     /*set the subclass of the CSS3 box model and divide them equally*/ - -webkit-box-flex:1; + -moz-box-flex:1; - Box-flex:1; +  A Border:1px solid #fff; at text-align:Center; -   } -   </style> - </Head> -  - <Body> in  - <Divclass= "Box3"> to   < Section>1</ Section> +   < Section>2</ Section> -   < Section>3</ Section> the </Div> *  $ </Body>Panax Notoginseng </HTML>

Above is the most basic code of the CSS3 box model.

Display:-*-box; Is the parent container that defines the box model.

-*-Box-flex: 1; Is the scale of the child container that defines the box model in the parent container.

As 1,2,1, it means Section1, 2 and 3, respectively, Occupy 25%,50%,25%.

And-*-box has the following properties:

-*-box-orient: Horizontal | Vertical | Inline-axis | Block-axis | Inherit

Used to determine whether the layout of child containers in the parent container is a horizontal or vertical layout. (Default Level)

-*-box-direction: normal | Reverse | Inherit

Used to determine the order of the sub-containers, as reverse, that is, 123 in the page into a 321 arrangement

-*-box-align: Start (top-aligned) | End (bottom-aligned) | Center (center Alignment) | Baseline | Stretch (stretch, stretch to and parent container height)

Used to determine the vertical alignment of a child container.

-*-box-pack: Start | End | Center | Justify

Used to determine the horizontal alignment of a child container.

CSS3.0 Box Model: Display:-webkit-box

Related Article

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.