The difference between Display:box and Flex

Source: Internet
Author: User

No difference, only the draft of each stage is named.

Flex is up to date, but in a real-world browser test, Display:flex cannot completely replace display:-webkit-box

Display:box use can refer to http://www.html5rocks.com/en/tutorials/flexbox/quick/
Display:flex use can refer to https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Compatibility issues can refer to the https://css-tricks.com/old-flexbox-and-new-flexbox/
The Android UC Browser only supports Display:box syntax. And the iOS UC browser supports two different ways
Note that if you want to use Line-clamp, you need to use Display:box; The syntax of the following two: flex syntax can be traced to this blog box syntax as follows, blog address:

Flexbox gives the display property a new value (that is, box value), Flexbox has many properties, and records some of the more commonly used properties: the style used for the parent element:

Display:box; This property adds this element and its immediate descendants to the Flex-box model. (Flexbox model applies only to direct descendants)

box-orient: Horizontal | Vertical | Inherit This property defines how the child elements of the parent element are arranged.

box-pack: Start | End | Center | Justify; Sets the way to arrange the neutron elements of the parent element along the box-orient axis. Therefore, if the box-orient is horizontal, the child elements of the parent element are arranged horizontally, and vice versa. (Indicates the horizontal alignment of the face container in the parent container – vertical arrangement – Fixed width)

box-align: Start | End | Center | Baseline | Stretch Basically, the sibling attribute of the Box-pack. Sets how the descendants of the box are arranged in the box. If the orientation is horizontal, the property determines the vertical arrangement and vice versa. (Represents the vertical alignment of the face container in the parent container-the horizontal arrangement – fixed height) for the child element's style:

Box-flex: 0 | any number; This property allows the child container to be divided by certain rules for the width of the parent container.

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.