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