综合练习题3.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. .header{
  9. text-align: center;
  10. background-color: #ccc;
  11. height: 100px;
  12. line-height: 100px;
  13. }
  14. .nav{
  15. text-align: center;
  16. background-color: #ccc;
  17. height: 50px;
  18. line-height: 50px;
  19. margin-top: 10px;
  20. }
  21. .left,.center,.right{
  22. height: 300px;
  23. /* background-color: #ccc; */
  24. text-align: center;
  25. line-height: 300px;
  26. float: left;
  27. }
  28. .content{
  29. margin-top: 10px;
  30. }
  31. .content::after{
  32. content: "";
  33. display: block;
  34. clear: both;
  35. }
  36. .content .left{
  37. width: 20%;
  38. background-color: #ccc;
  39. }
  40. .content .center{
  41. width: 60%;
  42. }
  43. .content .center-box{
  44. background-color: #ccc;
  45. margin:0 10px;
  46. }
  47. .content .right{
  48. width: 20%;
  49. background-color: #ccc;
  50. }
  51. .footer{
  52. background-color: #ccc;
  53. text-align: center;
  54. height: 100px;
  55. line-height: 100px;
  56. margin-top: 10px;
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <div class="container">
  62. <div class="header">头部区域</div>
  63. <div class="nav">菜单导航区域</div>
  64. <div class="content">
  65. <div class="left">左侧内容</div>
  66. <div class="center">
  67. <div class="center-box">
  68. 中间区域
  69. </div>
  70. </div>
  71. <div class="right">右侧内容</div>
  72. </div>
  73. <div class="footer">底部区域</div>
  74. </div>
  75. </body>
  76. </html>