当前位置:网站首页>Flex box flex attribute
Flex box flex attribute
2022-06-24 18:34:00 【Dolphins love cats I】
+flex Elastic element
=> Change everything Sub level The arrangement of elements
=> When you set up display flex It's time
=> Elastic parent : Set up display flex Get element
=> Elastic children : All its child elements
+ Properties of the elastic parent
1. flex-direction Indicates the spindle direction
+ The default value is :
row: Indicates horizontal arrangement , From left to right , The side axes are arranged vertically from top to bottom
+ Optional value :
row-reverse: Indicates horizontal arrangement , From right to left , The side axes are arranged vertically from top to bottom
column: Indicates vertical arrangement , From top to bottom , The side axes are arranged horizontally from left to right
column-reverse: Indicates vertical arrangement , From bottom to top , The side axes are arranged horizontally from left to right
2. justify-content Indicates the arrangement of elements in the spindle direction ( Do not change element order )
+ The default value is :
flex-start: All elements are stacked at the start of the spindle
+ Optional value :
flex-end: All elements are stacked at the end of the spindle
center: All elements are centered
space-between: All blanks are filled in between the two ( The top grid of the left and right elements )
space-around: All white space surrounds each child element twice
=> The blank space is 200px
=> Is the total 6 Elements
=> Just put 200 It is divided into 12 Share
=> Put a copy of each element on one side
space-evenly: Means to divide all blank spaces equally
=> The spacing between each element
=> It is consistent with the spacing between elements and edges of the two passes
=> Be careful : This value Android I won't support it , Only IOS Support
3. aline-items Indicates the arrangement of the side axes
+ Premise : When the child element does not wrap ( When there is only one line )
=> Multiple lines can also take effect , But not as we thought
=> Is to go to the specified position on the side axis of the child
+ The default value is :
flex-start: Indicates that the arrangement is at the beginning of the side axis
+ Optional value :
flex-end: Indicates that the arrangement is at the end of the side axis
center: Indicates that the arrangement is at the center of the side axis
4. flex-wrap Indicates whether line wrapping is enabled
+ The default value is :
no-wrap: Indicates that line breaks are not allowed
+ Optional value :
wrap: Indicates that line breaks are possible
+ Line break rules
1. Calculate how many lines you can change (3 That's ok )
2. Divide the side shaft into three parts ( Divide three equally )
3. The side shaft does not squash elements , If you go out, it will overflow directly
5. aline-content Indicates the arrangement of the side axes ( Multiple lines )
+ Premise : You have to turn on line feed , When there are multiple lines of elements
+ Set rules :
=> Think of each line as a whole
=> When setting , Is a unit of behavior
=> Set with the integral side shaft
+ The default value is : No,
+ Optional value :
flex-start: All units stack at the beginning of the side axis
flex-end: All units are stacked at the end of the side axis
center: All units are stacked in the middle of the side axis
space-between: The blank space on all side axes is equally divided between every two units
=> Top grid of upper and lower units
space-around: The blank space on all side axes is evenly surrounded on both sides of each unit
space-evenly: The units on all the side axes are evenly distributed in the middle position
When there is no child element inside an element , Only the text
+ Will treat all text content as a child element
6.flex-flow Is a collection of two properties
+flex-direction and flex-wrap Set
Attributes on elastic children
1. aline-self Represents the side axis arrangement of a single element
+ The default value is : Follow the parent's side axis arrangement settings
+ Optional value :
start: It means that I am arranged separately at the beginning of the side axis
end: It means that I am arranged separately at the end of the side axis
center: It means that I am arranged separately in the middle of the side axis
+ More time to go
=> How often do your child elements line up , The child elements on each row have their own independent row side axes
=> It moves on its own independent side axis
=> When your elastic parent has set the multi row side axis arrangement , The independent side axis of each element is the same
2. flex Say how many shares you have in the total
+ flex: Numbers ;
+ Each child element can be set felx It can also be set without
+ You need to set everything up felx The value of the element of the attribute Sum up (10)
+ Each element is set to flex Why , Just stand A few tenths
+ Is the value of all the child elements after the fixed width is set
+ Elastic width
+ When you set the elastic width
=> There will be content squeeze behavior
=> When the content is squeezed , Priority extrusion elastic The element of width
=> Until the width of the elastic element can no longer be squeezed , Extrude fixed width elements
=> Until all the elements can no longer be squeezed , It will overflow
3. order Indicates the sort position you are in
+ order: Numbers ;
+ Determine your own sort position
+ Set their order relationship
+ The larger the number, the more backward it is
边栏推荐
- Leetcode skimming questions - the 72nd biweekly match and 281 weekly match
- How about China Power Investment Xianrong futures? Is it safe to open futures accounts?
- Using flex to implement common layouts
- Uniapp wechat applet calls mobile map to navigate to the target point
- Leetcode question 136 [single number]
- The mixed calculation of rpx and PX in JS by the uniapp applet
- On software requirement analysis
- Selection (031) -cool_ How long can secret be accessed?
- 13 ways to reduce the cost of cloud computing
- Wechat applet development - Implementation of rotation chart
猜你喜欢
SDL: cannot play audio after upgrading openaudio to openaudiodevice
The country has made a move! Launch network security review on HowNet
Leetcode weekly buckle 281
[untitled]
Online sequence flow chart making tool
Eight recommended microservice testing tools
On software requirement analysis
微服务系统设计——接口文档管理设计
解决执行MapReduce程序控制台没有日志信息WARN Please initialize the log4j system properly
How to start cloud native application development
随机推荐
EasyGBS视频平台TCP主动模式拉流异常情况修复
RestCloud ETL抽取动态库表数据实践
Get the actual name of the method parameter through the parameter
How MySQL works - Chapter 14
Five skills of selecting embedded programming language
Mental models: the best way to make informed decisions - farnam
How to start cloud native application development
R中的指数回归
国家出手了!对知网启动网络安全审查
Five advantages and disadvantages of Bi
Skills of writing test cases efficiently
Creating a new MySQL user in Amazon RDS environment - creating a new MySQL user in Amazon RDS environment
Ten excellent business process automation tools for small businesses
Business leaders compete for CIO roles
EasyNVR使用Onvif探测设备失败,显示“无数据”是什么原因?
Wechat applet development - Implementation of rotation chart
Wechat applet to realize stacked rotation
Mariana Trench, Facebook's open source code analysis tool
congratulate! The first dragon lizard community annual outstanding contribution award is announced. Check it now
Palindrome string (two methods)