7_flex.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: stretch; */
  27. }
  28. li{
  29. list-style: none;
  30. width: 100px;
  31. height: 100px;
  32. background-color: orangered;
  33. margin: 10px;
  34. /* float: left; */
  35. color: #fff;
  36. text-align: center;
  37. line-height: 100px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <!-- <a href="https://www.runoob.com/w3cnote/flex-grammar.html">flex 文档</a> -->
  43. <ul>
  44. <li>1</li>
  45. <li>2</li>
  46. <li>3</li>
  47. <li>4</li>
  48. <li>5</li>
  49. <li>6</li>
  50. </ul>
  51. </body>
  52. </html>