当前位置:网站首页>移动端-flex项目属性
移动端-flex项目属性
2022-07-29 05:10:00 【冰眸js】
1.align-self单个项目在交叉轴的对齐方式
flex-start:交叉轴的起点对齐。flex-end:交叉轴的终点对齐。center:交叉轴的中点对齐。baseline: 项目的第一行文字的基线对齐。stretch(默认值):如果项目未设置高度或设为auto,将占满整个项目的高度。
.box .con:nth-of-type(1){
background-color: #f00;
/* align-self: auto; */
/* align-self: flex-start; */
align-self: flex-end;
/* align-self: center; */
}2.order属性定义项目的排列顺序。数值越小,排列越靠前,默认为0 ,只能是整数
.box .con:nth-of-type(2){
background-color: #0f0;
order: 1;
}3.flex-grow属性定义项目的放大比例,默认为0,即如果存在剩余空间,也不放大
.box .con:nth-of-type(2){
background-color: #0f0;
flex-grow: 2;
}
.box .con:nth-of-type(3){
background-color: #00f;
flex-grow: 1;
}4.flex-shrink属性定义了项目的缩小比例,默认为1,即如果空间不足,该项目将缩小。
.box .con{
width: 200px;
height: 200px;
flex-shrink: 1;
}5.flex-basis属性定义了在分配多余空间之前,项目占据的主轴空间(main size)。
浏览器根据这个属性,计算主轴是否有多余空间。它的默认值为
auto,即项目的本来大小。它可以设为跟
width或height属性一样的值(比如350px),则项目将占据固定空间。
6.flex属性是flex-grow, flex-shrink 和 flex-basis的简写,默认值为0 1 auto。后两个属性可选。
边栏推荐
猜你喜欢

Day 3

Day 2

Day 1

哈夫曼树以及哈夫曼编码在文件压缩上的应用
![[event preview] cloud digital factory and digital transformation and innovation forum for small and medium-sized enterprises](/img/6f/f7c5d605ea9b7b9e7c49ac716492ef.jpg)
[event preview] cloud digital factory and digital transformation and innovation forum for small and medium-sized enterprises

VIM editor use

Day 1

GPIO的输入输出详解

C language one-dimensional array

Live broadcast preview | how to save 30% labor cost and shorten 80% trademark processing cycle?
随机推荐
Cryengine3 debugging shader method
ClickHouse学习(四)SQL操作
Summary of the first week
题解:在一个排序数组中查找元素第一个和最后一个的位置 (个人笔记)
浅谈Servlet
牛客网编程题—【WY22 Fibonacci数列】和【替换空格】详解
About local variables
利用Poi-tl在word模板表格单元格内一次插入多张图片和多行单元格相同数据自动合并的功能组件
使用微信小程序扫码登录系统PC端web的功能
【C语言系列】— 打印100~200之间的素数
During the appointment, the 2022 JD cloud industrial integration new product launch was launched online
365 day challenge leetcode 1000 questions - day 039 full binary tree inserter + find peak II + snapshot array
Day 5
Abstract classes and interfaces
终端shell常用命令
C语言文件操作
数组学习之入门简单题 两数之和
365 day challenge leetcode1000 question - distance between bus stops on day 038 + time-based key value storage + array closest to the target value after transforming the array and + maximum value at t
存储类别
【C语言系列】— 把同学弄糊涂的 “常量” 与 “变量”