
1、flex-grow指扩展flex子项所占据的宽度,扩展的空间就是除去元素外剩余的空白间隙。
2、不支持负值,默认值是0,表示不占用剩余的空白间隙扩展自己的宽度。
如果flex-grow大于0,则flex容器剩余空间的分配就会发生。
实例
// HTML部分
<div>
<div></div>
<div></div>
<div></div>
</div>
// CSS部分
.box{
width: 600px;
height: 200px;
border: 1px solid;
display: flex;
}
.box div:nth-of-type(1){
width: 100px;
height: 100px;
background-color: red;
}
.box div:nth-of-type(2){
width: 150px;
height: 100px;
background-color: skyblue;
}
.box div:nth-of-type(3){
width: 200px;
height: 100px;
background-color: yellow;
}
本文教程操作环境:windows7系统、css3版,DELL G3电脑。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
长按识别二维码并关注微信
更方便到期提醒、手机管理