练习2_两列布局2.html 734 B

123456789101112131415161718192021222324252627282930313233343536
  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. *{
  9. margin: 0;
  10. padding: 0;
  11. }
  12. .box{
  13. height: 500px;
  14. display: flex;
  15. }
  16. .div1{
  17. width: 300px;
  18. height: 100%;
  19. background-color: red;
  20. }
  21. .div2{
  22. height: 100%;
  23. /* flex: 1; */
  24. flex-grow: 1;
  25. background-color: blue;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <div class="box">
  31. <div class="div1"></div>
  32. <div class="div2"></div>
  33. </div>
  34. </body>
  35. </html>