7_flex.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. body ul{
  9. margin: 0;
  10. padding: 0;
  11. min-height: 100vh;
  12. }
  13. ul{
  14. background-color: blue;
  15. /* flex 控制内部元素的布局 */
  16. display: flex;
  17. /* flex-direction 调整当前flex元素主轴方向 */
  18. /* flex-direction: row-reverse; */
  19. /* flex-direction: column-reverse; */
  20. /* flex-wrap 当内部的所有flex元素一行内容不下的时候换行 */
  21. /* flex-flow 是 flex-direction flex-wrap 的缩写*/
  22. /* flex-flow: row-reverse wrap; */
  23. /* justify-content: flex-end; */
  24. /* justify-content: space-around; */
  25. /* flex-direction: row-reverse; */
  26. /* align-items: center; */
  27. /* flex-wrap: wrap;
  28. align-content: flex-end; */
  29. }
  30. li{
  31. list-style: none;
  32. /* width: 100px; */
  33. flex-basis: 100px;
  34. height: 100px;
  35. background-color: orangered;
  36. margin: 10px;
  37. /* float: left; */
  38. color: #fff;
  39. text-align: center;
  40. line-height: 100px;
  41. /* flex-grow: 1; */
  42. }
  43. li:nth-child(3){
  44. /* order: -1; */
  45. /* flex-grow: 1; */
  46. /* flex-shrink: 0; */
  47. align-self: flex-end;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <!-- <a href="https://www.runoob.com/w3cnote/flex-grammar.html">flex 文档</a> -->
  53. <ul>
  54. <li>1</li>
  55. <li>2</li>
  56. <li>3</li>
  57. <li>4</li>
  58. <li>5</li>
  59. <li>6</li>
  60. <!-- <li>1</li>
  61. <li>2</li>
  62. <li>3</li>
  63. <li>4</li>
  64. <li>5</li>
  65. <li>6</li>
  66. <li>1</li>
  67. <li>2</li>
  68. <li>3</li>
  69. <li>4</li>
  70. <li>5</li>
  71. <li>6</li> -->
  72. </ul>
  73. </body>
  74. </html>