练习17_垂直居中.html 678 B

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