13_解决浮动问题.html 774 B

1234567891011121314151617181920212223242526272829303132333435
  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. .box1{
  9. border:1px solid black;
  10. /* border-width: 1px;
  11. border-style: solid;
  12. border-color: black; */
  13. width: 300px;
  14. height: 300px;
  15. }
  16. .box2,.box3{
  17. width: 100px;
  18. height: 100px;
  19. }
  20. .box2{
  21. background-color: red;
  22. }
  23. .box3{
  24. background-color: blue;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="box1">
  30. <div class="box2"></div>
  31. <div class="box3"></div>
  32. <span>hello</span>
  33. </div>
  34. </body>
  35. </html>