We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flex布局也称弹性布局,拥有display:flex属性的元素内部子元素可以进行特殊排版
<div class="div2"> <div class="div21">123</div> <div class="div22">12312</div> </div> <style type="text/css"> .div2{ display: flex; width:300px; height:300px; background:pink; } .div21 { flex:2; /* 5分之2*/ background:gray; } .div22 { flex:3; /*5分之3*/ background:yellow; } </style>
.box { display: -webkit-flex; /* Safari 带前缀的放前面 */ display:flex;/*行内元素为display:inline-flex*/ }
flex-direction flex-wrap flex-flow justify-content align-items align-content
.box { flex-direction: row | row-reverse | column | column-reverse; }
.box{ flex-wrap: nowrap | wrap | wrap-reverse; }
.box { justify-content: flex-start | flex-end | center | space-between | space-around; }
.box { align-items: flex-start | flex-end | center | baseline | stretch; }
参考阮一峰flex
The text was updated successfully, but these errors were encountered:
No branches or pull requests
flex弹性布局
标准写法
总共有6个属性可以设置在box上
flex-direction设置主轴的方向
flex-wrap表示如果一排放不下,如何换行
justify-content设置左对齐方式
align-items属性定义项目在交叉轴上如何对齐
参考阮一峰flex
The text was updated successfully, but these errors were encountered: