当前位置:网站首页>Elastic box flex
Elastic box flex
2022-07-29 05:44:00 【Ice eyes JS】
Elastic box
Flex Layout , It's easy 、 complete 、 Responsive implementation of various page layouts ;
.box{ display:flex; }Webkit Browser for kernel , Have to add
-webkitPrefix ;Set to Flex After the layout , The child element
float、clearandvertical-alignProperty will fail .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 ".
The container has two axes by default : Horizontal spindle (main axis) And the vertical cross axis (cross axis). Starting position of spindle ( The intersection with the border ) be called
main start, The ending position is calledmain end; The starting position of the cross axis is calledcross start, The ending position is calledcross end.
Container attribute
1.justify-content Property defines the alignment of the item on the spindle
flex-start:( The default value is ) Align leftflex-end: Right alignmentcenter: In the middlespace-between: full-justified , The intervals between the items are all equal .space-around: The spacing between each item is equal .- space-evenly: The distance between each two items And The distance between the edge item and the container is equal
2.align-items Property defines how items are aligned on the cross axis
flex-start: Align the starting points of the intersecting axes Top alignmentflex-end: The ends of the intersecting axes are aligned Stay downcenter: Align centerbaseline: Baseline alignment of the first line of text for the project .stretch:The default value is : If the project is not set to height or set to auto, Will fill the entire container .
3.flex-direction Property determines the direction of the spindle ( That is, the arrangement direction of the project )
row:( The default value is ) The principal axis is horizontal , The starting point is on the left .row-reverse: The principal axis is horizontal , The starting point is on the right .column: The principal axis is perpendicular , The starting point is on the upper side .column-reverse: The principal axis is perpendicular , The starting point is on the lower side .
4.flex-wrap Attribute definitions , If an axis doesn't line up , How to wrap .
When there is not enough space in the container , Items are smaller than columns
Space left , The project department will become bigger
nowrap:( Default ) Don't wrapwrap: Line break , The first row is at the topwrap-reverse: Line break , The first row is at the bottom
5.align-content Property defines the alignment of multiple axes
- flex-start: The whole project is aligned with the starting point of the cross axis . Live on
- flex-end: The whole project is aligned with the end of the cross axis . Stay down
- center: The whole project is aligned with the midpoint of the cross axis . In the middle
- space-between: The distance between every two lines is equal .
- space-around: The spacing on both sides of each line is equal .
- space-evely: The distance between every two lines And The distance between the edge item and the container is equal
- stretch( The default value is ): The axis occupies the entire cross axis
边栏推荐
- Basic concepts of MySQL + database system structure + extended application + basic command learning
- Qtcreator+cmake compiler settings
- How does the MD editor of CSDN input superscripts and subscripts? The input method of formula and non formula is different
- Seay source code audit system
- WIN10 编译ffmpeg(包含ffplay)
- Crypto巨头们ALL IN元宇宙,PlatoFarm或能突围
- 改哭了,终于解决了Cannot read properties of undefined (reading ‘parseComponent‘)
- Detailed explanation of typical application code of C language array - master enters by mistake (step-by-step code explanation)
- php写一个购买全网最低价的纸尿裤
- Countdown of the uniapp component (such as the countdown to reading the agreement and the countdown to completing learning)
猜你喜欢

Starfish OS:以现实为纽带,打造元宇宙新范式
![[C language series] - detailed explanation of file operation (Part 1)](/img/12/2d47fde0385d3f1dcb31f5efa82f7b.png)
[C language series] - detailed explanation of file operation (Part 1)
![[C language series] - print prime numbers between 100 and 200](/img/61/5b9dea72e7a3fd450a87fe35fb94eb.png)
[C language series] - print prime numbers between 100 and 200

Sqlmap是什么以及使用方法
![[C language series] - storage of deep anatomical data in memory (II) - floating point type](/img/a4/126d9f8e812d8f69b4249eac837bf6.png)
[C language series] - storage of deep anatomical data in memory (II) - floating point type

Win10 搭建MSYS2环境

QT setting background image method

农村品牌建设给年轻人的一些机会

Question swiping Madness - leetcode's sword finger offer58 - ii Detailed explanation of left rotation string

Merge the same items in the same column in table
随机推荐
移动端-flex项目属性
【TypeScript】TypeScript中类型缩小(含类型保护)与类型谓词
WIN10 编译ffmpeg(包含ffplay)
DAY14:Upload-labs 通关教程
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
基础爬虫实战案例之获取游戏商品数据
php写一个购买全网最低价的纸尿裤
The openatom openharmony sub forum was successfully held, and ecological and industrial development entered a new journey
Okaleido Tiger 7.27日登录Binance NFT,首轮已获不俗成绩
sql-server 数据表的简单操作
Masscan tutorial
打印出1-100之间的所有质数
[untitled]
DAY13:文件上传漏洞
MySQL decompressed version windows installation
弹性盒子相关知识
Provincial and urban three-level linkage (simple and perfect)
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了
新手入门:手把手从PHP环境到ThinkPHP6框架下载
Build msys2 environment with win10