test.html 889 B

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Document</title>
  8. <style>
  9. .container {
  10. display: flex;
  11. flex-wrap: wrap;
  12. justify-content: space-between;
  13. }
  14. .box {
  15. flex-basis: calc(33.33% - 20px); /* 每个盒子的宽度 */
  16. margin-bottom: 20px; /* 垂直间距 */
  17. height: 100px;
  18. background-color: #f40;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <div class="container">
  24. <div class="box">Box 1</div>
  25. <div class="box">Box 2</div>
  26. <div class="box">Box 3</div>
  27. <div class="box">Box 4</div>
  28. <div class="box">Box 5</div>
  29. <div class="box">Box 6</div>
  30. </div>
  31. </body>
  32. </html>