当前位置:网站首页>弹性盒/伸缩盒(flex)的使用
弹性盒/伸缩盒(flex)的使用
2022-07-27 05:03:00 【real代码渣渣】
文章目录
弹性盒(flex)
css中的一种布局手段,主要用来代替浮动来完成页面的布局,能够使得元素具有弹性,让元素跟随页面的大小改变而改变。
弹性容器:使用弹性盒必须将一个元素先设置为弹性容器
- display:flex,设为块级弹性容器
- display:inline-flex,设为行内弹性容器
弹性元素:弹性容器的子元素是弹性元素。
flex-direction:弹性容器的排列方式
– row:默认值,弹性元素水平从左向右排列
– row-reverse:反向水平排列,从右向左排列
– colum:弹性元素纵向从上向下排列
– colum-reverse:弹性元素反向纵向自下向上排列flex-grow:弹性元素的伸展系数
flex-shrink:弹性元素的收缩系数
flex-wrap:弹性元素在弹性容器中自动换行
– nowrap:默认值,不会换行
– wrap:元素沿着辅轴方向自动换行
– wrap-reverse:元素沿辅轴反方向自动换行justify-content:如何分配主轴上空白区间
– flex-start:沿着主轴开始边排列
– flex-end:沿着主轴终点边排列
– center:元素居中排列
– space-around:空白分布到元素两侧
– space-evenly:空白分不到元素的单侧
– space-between:空白均匀分不到元素之间align-item:元素在辅轴上的对齐方式
– stretch:默认值,将元素的长度设置为相同的值
– flex-start:元素不会拉伸,沿着辅轴起边对齐
– flex-end:元素不会拉伸,沿着辅轴终边对齐
– center:居中对齐
– baseline:基线对齐align-content:辅轴空白部分的分布,可选值与justify-content相同
flex-basis:元素在主轴上的基础长度。如果主轴是横向的,则指定的是宽度;若主轴是纵向的,则指定的是高度。
边栏推荐
- 268.missing number of leetcode
- Pytorch installation new pit
- 程序环境和预处理(上):一个程序是怎么成功运行的?
- MQ set expiration time, priority, dead letter queue, delay queue
- SQL(MySql)菜鸟教程知识
- Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline
- 流程控制-分支
- p7 day1 初识Flask框架
- Li Hongyi machine learning team learning punch in activity day05 --- skills of network design
- Message reliability processing
猜你喜欢

Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline

elment-ui使用方法

分享一道关于程序编译过程的选择题(内含编译过程浅谈,符号表的形成合并过程)

Pinball games

Message reliability processing

2021 Niuke multi school training camp 5 (question b)

背景图片相关应用-铺满,自适应

李宏毅机器学习组队学习打卡活动day05---网络设计的技巧

Share a multiple-choice question about variables (including global variables, local variables, the scope of variables, and life cycle knowledge points)

Flask请求数据获取与响应
随机推荐
Redis publish subscribe mode
torch中乘法整理,*&torch.mul()&torch.mv()&torch.mm()&torch.dot()&@&torch.mutmal()
redis持久化
如何查看导师的评价
MQ set expiration time, priority, dead letter queue, delay queue
Share a multiple-choice question about variables (including global variables, local variables, the scope of variables, and life cycle knowledge points)
原生token生成加密、解密
Program environment and preprocessing (Part 1): how does a program run successfully?
Day5 --- Flask-RESTful请求响应与SQLAlchemy基础
规格管理,及规格选项管理功能实现
Sparse array → saving and continuation of Gobang
初识C语言——初识指针
Looking at the PK of alphago and Li Shishi from a deep perspective
李宏毅机器学习组队学习打卡活动day03---误差和梯度下降
How to view the evaluation of tutors
【C语言switch分支语句和循环语句】
我的第一篇博客
上传七牛云的方法
Li Hongyi machine learning team learning punch in activity day04 - Introduction to deep learning and back propagation mechanism
Differences among bio, NiO and AIO