当前位置:网站首页>Align items and align content in flex layout
Align items and align content in flex layout
2022-07-06 03:38:00 【Under the white night】
Definition
align-items : Attribute definitions flex children stay flex Container of Current row The side axis of ( The vertical axis ) In the direction of Alignment mode .
center: The element is in the center of the container .
The elastic box element is on the side axis of the line ( The vertical axis ) Top center .( If the size of the line is smaller than the size of the elastic box element , It will overflow the same length in both directions ).
align-items:center
align-content: All lines inside the free box will be set as all in one Arrange vertically . in the light of Multiple lines The arrangement on the vertical axis as a whole , This attribute is not valid for single line .
center: The element is in the center of the container .
Each row is stacked towards the middle of the elastic box container . Each line is close to each other and aligned in the middle of the elastic box container , Keep the distance between the beginning content boundary of the side axis of the elastic box container and the first row equal to the distance between the end content boundary of the side axis of the container and the last row .( If the rest of the space is negative , Then each line will overflow an equal distance in both directions .)
There must be... In the container Multiple lines Project , This attribute can render the effect .
Be careful
align-items and align-content It has the same function , But the difference is that it is used to make everyone A single Instead of centering the entire container .
Because both are defined in flex Position of the element in the layout , therefore align-items And align-content To work with display:flex Use it together
expand
- flex Layout :Flex yes Flexible Box Abbreviation , Translated into Chinese “ Elastic box ”, Used to provide maximum flexibility for boxed models . Any container can be specified as Flex Layout .
- use Flex Elements of layout , be called Flex Containers (flex container), abbreviation ” Containers ”. All its child elements automatically become container members , be called Flex project (flex item), abbreviation ” project ”.
Reference resources :
Reference resources 1
Reference resources 2( Rookie programming )
边栏推荐
猜你喜欢
2.2 STM32 GPIO操作
[meisai] meisai thesis reference template
Four logs of MySQL server layer
MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
BUAA计算器(表达式计算-表达式树实现)
Flask learning and project practice 9: WTF form verification
Blue style mall website footer code
Svg drag point crop image JS effect
遥感图像超分辨重建综述
SWC introduction
随机推荐
Pytorch基础——(1)张量(tensor)的初始化
Remote Sensing Image Super-resolution and Object Detection: Benchmark and State of the Art
Item 10: Prefer scoped enums to unscoped enums.
暑期刷题-Day3
ASU & OSU | model based regularized off-line meta reinforcement learning
RT-Thread--Lwip之FTP(2)
施努卡:3d视觉检测应用行业 机器视觉3d检测
SAP ALV单元格级别设置颜色
Cubemx transplantation punctual atom LCD display routine
给新人工程师组员的建议
1.16 - 校验码
[matlab] - draw a five-star red flag
简述C语言中的符号和链接库
Factors affecting user perception
2.1 rtthread pin设备详解
Pytoch foundation - (2) mathematical operation of tensor
The solution of permission denied (750 permissions should be used with caution)
[analysis of variance] single factor analysis and multi factor analysis
【RISC-V】外部中断
LTE CSFB test analysis