Flex of flexible Flexible box model

Source: Internet
Author: User

Instance

Let all the child elements of the elastic box model object have the same length, ignoring the contents of their interior:

    1. # Main Div
    2. {
    3. Flex : 1 ;
    4. }
CopyEffect Preview Browser support

The number in the table represents the version number of the first browser that supports the property.

The number immediately following the-webkit-,-ms-or-moz-is the first version that supports the prefix attribute.

Definition and usage

Flex properties are used to set or retrieve how the child elements of a flexible box model object allocate space.

Flex properties are shorthand properties for the Flex-grow, Flex-shrink, and Flex-basis properties.

Note: If the element is not a child of the elastic box model object, the Flex property does not work.

0 1 auto
inherit: no
can be animated: Yes, see individual properties . See  CSS3 Animation properties, CSS3 animated instances
version: CSS3
JavaScript Syntax: object. style.flex= "1" effect preview

CSS Syntax Flex: Flex-grow Flex-shrink flex-basis|auto|initial|inherit; property value
value Description
flex-grow A number that specifies how much the project will scale relative to other flexible projects.
flex-shrink A number that specifies how much the project will shrink relative to other flexible projects.
flex-basis length of the project. Legal value: "Auto", "inherit" or a number followed by "%", "px", "em", or any other length unit.
auto same as 1 1 auto.
none same as 0 0 auto.
initial Set this property to its default value, which is 0 1 auto. See   initial .
Inherit Inherit the property from the parent element. See inherit.

Flex of flexible Flexible 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.