Blogger Information
Blog 19
fans 0
comment 0
visits 10225
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
CSS学习_0705作业
bloght5386
Original
507 people have browsed it

作业内容:实例演示flex容器与项目中常用的属性,并写出功能。

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <style>
  7. * {
  8. margin: 0;
  9. padding: 0;
  10. box-sizing: border-box;
  11. }
  12. :root {
  13. font-size: 10px;
  14. }
  15. body {
  16. font-size: 1.6rem;
  17. }
  18. .container {
  19. border: 1px solid;
  20. width: 29em;
  21. height: 20em;
  22. display: flex;
  23. /* flex-wrap: nowrap; *//* 默认不换行 */
  24. /* flex-wrap: wrap;//换行 */
  25. /* flex-direction: row; 行的方向*/
  26. /* flex-direction: row-reverse;反向 */
  27. /* flex-direction: column;列的方向 */
  28. /* 简写: */
  29. /* flex-flow: row wrap;主轴方向换行 */
  30. /* justify-content: flex-start; */
  31. /* justify-content: flex-end; */
  32. /* justify-content: space-between;两端对齐 */
  33. /* justify-content: space-around;分散对齐 */
  34. /* justify-content: space-evenly;平均对齐 */
  35. /* flex-basis: 25em;项目在主轴上的宽度 */
  36. /* flex-shrink: 0;不收缩 */
  37. /* flex-shrink: 1;收缩 */
  38. /* flex-grow: 0;禁止放大 */
  39. /* flex-grow: 1;允许放大 */
  40. /* flex: 0 1 auto;禁止放大 允许收缩 宽度自动 */
  41. }
  42. .container>.item {
  43. padding: 1em;
  44. border: 1px solid;
  45. background-color: aquamarine;
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <div class="container">
  51. <div class="item">item1</div>
  52. <div class="item">item2</div>
  53. <div class="item">item3</div>
  54. <div class="item">item4</div>
  55. </div>
  56. </body>
  57. </html>
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