01-体验flex布局.html 798 B

12345678910111213141516171819202122232425262728293031323334353637
  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>体验flex布局</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. .box {
  14. display: flex;
  15. justify-content: space-between;
  16. /* height: 200px; */
  17. border: 1px solid #000;
  18. }
  19. .box div {
  20. /* float: left;
  21. margin: 10px; */
  22. width: 100px;
  23. height: 100px;
  24. background-color: pink;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="box">
  30. <div>1</div>
  31. <div>2</div>
  32. <div>3</div>
  33. </div>
  34. </body>
  35. </html>