弹性盒子

本文深入解析弹性盒子(Flexbox)布局,介绍其核心概念包括弹性容器与子元素,详细阐述了六个关键属性如flex-direction、flex-wrap等的作用及用法,并解析了如何通过order、flex-grow等属性调整子元素布局。

弹性盒子由弹性容器和弹性子元素组成

弹性容器:

两条轴:水平轴与竖直轴

6个属性:

flex-direction:row、column、row-reverse、column-reverse

flex-wrap:nowrap wrap wrap-reverse

flex-flow:row nowrap(flex-direction flex-wrap简写形式)

justify-content:flex-start flex-end center space-between space-around

align-items:flex-start flex-end center baseline stretch

aligh-content:flex-start flex-end center space-between space-around stretch

弹性子元素:

order:默认为0

flex-grow:1(水平竖直切分长度)

flex-shrink:默认为1,即缩小

flex-basis:重定义长度

flex:0,1,auto(默认值,flex-grow flex-shrink flex-basis的简写)

align-self:改属性允许元素与其他元素对齐方式不同,可覆盖align-items属性,可取值flex-start flex-end center baseline stretch

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值