Blogger Information
Blog 14
fans 0
comment 0
visits 7644
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
flex容器与项目常用属性
深巷的博客
Original
345 people have browsed it

flex容器与项目常用属性

Flex是Flexible Box的缩写 flex布局表示弹性布局,可以为盒状模型提供最大的灵活性。

1.容器属性

属性 说明
display 容器类型(flex / inline-flex)
flex-flow 主轴方向与是否换行
place-content 项目在”主轴”上的排列方式
place-items 项目在”交叉轴”上的排列方式

2.项目属性

属性 说明
flex 项目在”主轴”上的缩放比例与宽度
place-self 项目在”交叉轴”上的排列方式
order 项目在”主轴”上的排列顺序

3.示例和图示

flex图示

  1. <div class="container">
  2. <div class="item">item1</div>
  3. <div class="item">item2</div>
  4. <div class="item">item3</div>
  5. </div>
  6. <style>
  7. .container {
  8. width: 300px;
  9. height: 50px;
  10. display: flex;
  11. place-content: space-around;
  12. }
  13. .container>.item {
  14. background-color: darkkhaki;
  15. }
  16. </style>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:总结的不错,继续加油
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post