Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Is flex a css attribute?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces whether flex is a css attribute or not, which can be used for reference by interested friends. I hope you can learn a lot after reading this article.

Flex is a css attribute. The css flex attribute is an abbreviated property of the flex-grow, flex-shrink, and flex-basis properties that sets or retrieves how the child elements of the elastic box model object allocate space; if the element is not a child of the elastic box model object, the flex attribute has no effect.

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

Flex is a css attribute.

The flex property is used to set or retrieve how the child elements of the elastic box model object allocate space.

The flex property is an abbreviated property of the flex-grow, flex-shrink, and flex-basis properties, with a default value of 0 1 auto.

This property has two shortcut values: auto (1 1 auto) and none (0 auto). It is recommended that you give priority to using this property rather than writing three separate properties separately, because the browser calculates the relevant values.

Note: if the element is not a child of the elastic box model object, the flex attribute has no effect.

Syntax:

Flex: flex-grow flex-shrink flex-basis | auto

Flex-grow a number that specifies the amount by which the project will be expanded relative to other flexible projects.

Flex-shrink a number that specifies the amount by which the project will shrink relative to other flexible projects.

The length of the flex-basis project. Legal value: "auto", "inherit" or a number followed by "%", "px", "em" or any other unit of length.

Auto is the same as 11 auto.

None is the same as 0 auto.

Example:

# main {width:220px; height:300px; border:1px solid black; display:flex;} # main div {flex:1;} Green div with more content in red and blue

Thank you for reading this article carefully. I hope the article "flex is not a css attribute" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report