当前位置:网站首页>flex布局
flex布局
2022-07-26 05:45:00 【zcy_wxy】
一 说明
flex布局是一种html盒模型布局方式。
二 使用
基于父元素。父元素必须使用display:flex;来声明其子元素使用flex布局。
除了声明display,其还有以下属性来控制子元素的布局:
1) 属性名称:flex-direction 主轴方向
属性值:
- row(自左向右横向布局)
- row-reverse(自右向左横向布局)
- column(自上而下竖向布局)
- column-reverse(自下而上竖向布局)
2) 属性名称:justify-content 对齐方式
属性值:
- flex-start 从起点开始
- space-between:先两边贴边,再平分剩余空间
- space-around:平分剩余空间
- center:居中
- flex-end:从终点开始
3) 属性名称:flex-wrap 换行方式
属性值:
- nowrap:不换行
- wrap:换行
4) 属性名称:align-items 单行侧轴对齐方式
属性值:
- flex-start 从起点开始
- flex-end:从终点开始
- center:居中
- stretch:拉伸,不能设置元素高度
5) 属性名称:align-content 多行侧轴对齐方式
属性值:
- flex-start 从起点开始
- flex-end:从终点开始
- center:居中
- space-around:平局分剩余空间
- space-between:先两边贴边,再平分剩余空间
- stretch:拉伸,不能设置元素高度
6) 属性名称:合写flex-directon和flex-wrap
三 子项属性
flex:所占剩余空间的份数,盒子必须有宽高,然后才能有剩余。
比例=子项flex值/各子项flex值加和
align-self:单个子项的对齐方式
order:修改排列顺序
边栏推荐
- You'd better not take this kind of project!
- Three graduates, three years of experience in embedded software
- Project topic selection reference
- Yuancosmos provides a digital social platform for fashion design display
- STL common template library
- 高手是怎样炼成的?
- Why can't lpddr completely replace DDR?
- leetcode-Array
- 中文文本纠错任务简介
- Nn.moudle module - details of creating neural network structure
猜你喜欢

中文文本纠错任务简介

DOM操作--操作节点

CANoe-XML在Test Modules中的应用

Select sort / insert sort / bubble sort

Benji Banas launched the second season of earn while playing bonus activities, supporting the use of multiple Benji passes!

Day011 one dimensional array

520 for what? DIY is a high-value RGB clock that girls want to watch

LNMP架构

Redis persistence RDB
C language explanation series -- understanding of functions (3) formal parameters, arguments, nested calls and chain access
随机推荐
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
DOM操作--操作节点
I also found excellent software and hardware projects, all open source
leetcode-aboutString
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
Benji Bananas 开启第二季边玩边赚奖励活动,支持使用多张 Benji 通行证!
选电子工程被劝退,真的没前景了?
Redis持久化-RDB
MongoDB 常用命令
YOLOV3预备工作
517. Super washing machine
Hack the box - Web requests module detailed Chinese tutorial
520 for what? DIY is a high-value RGB clock that girls want to watch
How to view the container name in pod
Yuancosmos provides a digital social platform for fashion design display
Hack the box -sql injection fundamentals module detailed Chinese tutorial
Redis publish subscription
Qt编写物联网管理平台47-通用数据库设置
IVR在voip电话系统的应用与价值
又一开源神器,值得收藏学习!