13_练习5总结.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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:3px solid black;
  10. }
  11. .box1 img{
  12. width: 50px;
  13. vertical-align: bottom;
  14. }
  15. .box1 span{
  16. font-size: 30px;
  17. }
  18. .box2{
  19. border:3px solid black;
  20. margin-top: 20px;
  21. font-size: 0;
  22. }
  23. .box2 div{
  24. width: 400px;
  25. height: 300px;
  26. background-color: blue;
  27. display: inline-block;
  28. }
  29. .box2 .div1{
  30. font-size: 20px;
  31. vertical-align: top;
  32. }
  33. .box2 .div2{
  34. font-size: 20px;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <!-- vertical-align 调整行元素、行块元素的垂直对齐方式 top middle bottom baseline -->
  40. <div class="box1">
  41. <img src="./image/arr.png" alt="arr">
  42. <span>Margin</span>
  43. </div>
  44. <div class="box2">
  45. <div class="div1">
  46. <p>1</p>
  47. <p>2</p>
  48. <p>3</p>
  49. </div>
  50. <div class="div2">
  51. <p>1</p>
  52. <p>2</p>
  53. </div>
  54. </div>
  55. </body>
  56. </html>