当前位置:网站首页>Flex layout
Flex layout
2022-07-25 15:28:00 【꧁ small ۣۖ Pigeon ۣۖ Puzi ۣۖ ิ꧂】
Traditional solutions for layout , Based on the box model , rely on display attribute + position attribute + float attribute .
It is very inconvenient for those special layouts , such as , Vertical centering is not easy to achieve .2009 year ,W3C Put forward a new scheme ----Flex Layout , It's easy 、 complete 、 Responsive implementation of various page layouts .
at present , It's supported by all browsers , It means , Now you can use this function safely
One 、Flex What is the layout ?
Flex yes Flexible Box Abbreviation , Meaning for " Elastic layout ", To provide maximum flexibility for box models . Any container can be specified as Flex Layout .
.box{
display: flex;
}
Inline elements can also be used Flex Layout .
.box{
display: inline-flex;
}
Webkit Browser for kernel , Have to add -webkit Prefix .
.box{
display: -webkit-flex; /* Safari */
display: flex;
}
Set up Flex After the layout , The child element float、clear and vertical-align invalid ;
Two 、 Basic concepts
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 ".
The container has two axes by default : Horizontal spindle (main axis) And the vertical cross axis . Starting position of spindle ( The intersection with the border ) be called main start, The ending position is called main end; The starting position of the cross axis is called cross start, The ending position is cross end.
Items are arranged along the main axis by default . The spindle space occupied by a single project is called main size, The space occupied by the cross axis is called cross size.
边栏推荐
猜你喜欢
随机推荐
为什么PrepareStatement性能更好更安全?
matlab 优化工具 manopt 安装
Take you to create your first C program (recommended Collection)
Overview of JS synchronous, asynchronous, macro task and micro task
Idea remotely submits spark tasks to the yarn cluster
CGO is realy Cool!
How to finally generate a file from saveastextfile in spark
Flink-1.13.6版本的 Flink sql以yarn session 模式运行,怎么禁用托管
matlab 如何保存所有运行后的数据
Spark sql 常用时间函数
MySql的安装配置超详细教程与简单的建库建表方法
Delayed loading source code analysis:
Spark partition operators partitionby, coalesce, repartition
Submarine cable detector tss350 (I)
ML - 语音 - 传统语音模型
小波变换--dwt2 与wavedec2
Notes on inputview and inputaccessoryview of uitextfield
Qtime定义(手工废物利用简单好看)
ML - 图像 - 深度学习和卷积神经网络
Recommend 10 learning websites that can be called artifact









