当前位置:网站首页>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 fonctionnement stm32 GPIO
- Quartz misfire missed and compensated execution
- Canvas cut blocks game code
- SAP ALV单元格级别设置颜色
- MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- EDCircles: A real-time circle detector with a false detection control 翻译
- Image super resolution using deep revolutionary networks (srcnn) interpretation and Implementation
- Leetcode problem solving -- 173 Binary search tree iterator
- Factors affecting user perception
猜你喜欢
1、工程新建
Explore pointers and pointer types in depth
【RISC-V】外部中断
Schnuka: 3D vision detection application industry machine vision 3D detection
3.1 rtthread 串口设备(V1)详解
【SLAM】lidar-camera外参标定(港大MarsLab)无需二维码标定板
2.2 STM32 GPIO操作
SAP ALV color code corresponding color (finishing)
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
2.1 rtthread pin设备详解
随机推荐
JS音乐在线播放插件vsPlayAudio.js
Esbuild & SWC: a new generation of construction tools
【Qt5】Qt QWidget立刻出现并消失
2.2 STM32 GPIO操作
2.13 weekly report
[rust notes] 18 macro
[meisai] meisai thesis reference template
Pytorch基础——(1)张量(tensor)的初始化
Quartz misfire missed and compensated execution
MPLS experiment
The real machine cannot access the shooting range of the virtual machine, and the real machine cannot Ping the virtual machine
Mapping between QoE and KQI
StrError & PERROR use yyds dry inventory
简述C语言中的符号和链接库
Svg drag point crop image JS effect
暑期刷题-Day3
[Massey] Massey font format and typesetting requirements
mysqldump数据备份
Explore pointers and pointer types in depth
Leetcode problem solving -- 108 Convert an ordered array into a binary search tree