flex布局


直接在父元素上 display: flex;justify-content: center; align-items: center; 内部子元素会自动水平居中

默认:flex-direction(滴瑞爱格寻): row (肉) 水平方向 column(靠冷) 垂直方向
加row-reverse(瑞沃斯) 方向反过来
flex-wrap:nowrap (默认不换行) wrap (乳啊) 换行
justify-content:flex-start; 左对齐默认
justify-content:flex-end; 右对齐
justify-content:center; 居中对齐
justify-content:space-between; 两端对齐
justify-content:space-around; 两端按中间对齐(额绕得)

交叉轴对齐
align-items:center; 垂直居中
align-items:flex-start; (最上方)
align-items:flex-end; (最下方)
align-items:stretch; 上下全占满 (斯最曲)
align-items:baseline; 按字体对齐 默认值

posted on   未茉  阅读(26)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
点击右上角即可分享
微信分享提示