Blogger Information
Blog 28
fans 0
comment 1
visits 21321
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
多行容器中的项目对齐方式
南宫
Original
652 people have browsed it
  1. <!-- align-content使用 -->
  2. <div class="container">
  3. <div class="item">1</div>
  4. <div class="item">2</div>
  5. <div class="item">3</div>
  6. <div class="item">4</div>
  7. <div class="item">5</div>
  8. <div class="item">6</div>
  9. <div class="item">7</div>
  10. <div class="item">8</div>
  11. </div>
  1. <style>
  2. .container{
  3. width: 300px;
  4. display: flex;
  5. /* 多行容器 放不下就会换行*/
  6. flex-wrap: wrap;
  7. height: 150px;
  8. /* align-content: 设置多行容器中的项目排列; */
  9. /* 1. 容器剩余空间在所有项目“二边”的如何分配 ,将全部项目视为一个整体*/
  10. align-content: stretch;
  11. align-content: flex-start;
  12. align-content: flex-end;
  13. align-content: center;
  14. /* 2. 容器剩余空间在所有项目“之间”的如何分配 ,将项目视为一个个独立的个体*/
  15. align-content: space-between;
  16. align-content: space-around;
  17. align-content: space-evenly;
  18. }
  19. .container > .item{
  20. width: 60px;
  21. }
  22. </style>
Correcting teacher:天蓬老师天蓬老师

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