Box-orient & box-direction of CSS3 elastic box model

Source: Internet
Author: User

CSS3 introduced a new box model-elastic box model, in fact, the previous article has already talked about a box-flex, today speaking of another two elastic box model properties Box-orient and box-direction.

1,box-origent: horizontal or vertical distribution.

Box-origent has two values: horizional (horizontal) and vertical (vertical), meaning the way the elements are arranged!

The CSS code is as follows:

Body {
Display:-webkit-box;

-webkit-box-orient: horizional;

}

The horizontal arrangement is as follows:

Body {
Display:-webkit-box;

-webkit-box-orient: vertical;

}

The vertical arrangement is as follows:

2,box-direction: Reverse Distribution

Box-direction also has two values normal (normal) and reverse (reverse), of course, if the use of course is generally for reverse! The function of this property is to turn an element that is originally arranged from 1-2-3 upside down: 3-2-1


Note: Both box-orient and box-direction need to be defined in the parent element to determine the arrangement of the child elements, and they work if the Display:box must set the display value to box, otherwise it will not take effect. There are also different browsers that must be prefixed (-webkit-、-moz-、-o-、-ms-, etc.).

3, In addition to box-direction can achieve the reverse distribution, there is a more specific method of disclosure, is defined in each child element of the attribute, it can even determine any sort order, 1-3-2,3-1-2 ... Yes, that's box-ordinal-group ,

Its value is a positive integer starting at 1, and the higher the value, the more advanced the urine is!

The CSS code is as follows:

. box1{-webkit-box-ordinal-group:1}

. box2{-webkit-Box-ordinal-group:3}

. box3{-webkit-Box-ordinal-group:2}

Box-orient & box-direction of CSS3 elastic box model

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.