1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <script src="http://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js"></script>
    6. </head>
    7. <style>
    8. body {
    9. min-width: 550px; /* 2x leftContent width + rightContent width */
    10. font-weight: bold;
    11. font-size: 20px;
    12. }
    13. #header, #footer {
    14. background: rgba(29, 27, 27, 0.726);
    15. text-align: center;
    16. height: 60px;
    17. line-height: 60px;
    18. }
    19. #footer {
    20. clear: both;
    21. }
    22. #container {
    23. padding-left: 200px; /* leftContent width */
    24. padding-right: 150px; /* rightContent width */
    25. overflow: hidden;
    26. }
    27. #container .column {
    28. position: relative;
    29. float: left;
    30. text-align: center;
    31. height: 300px;
    32. line-height: 300px;
    33. }
    34. #center {
    35. width: 100%;
    36. background: rgb(206, 201, 201);
    37. }
    38. #left {
    39. width: 200px; /* leftContent width */
    40. right: 200px; /* leftContent width */
    41. margin-left: -100%;
    42. background: rgba(95, 179, 235, 0.972);
    43. }
    44. #right {
    45. width: 150px; /* rightContent width */
    46. margin-left: -150px; /* rightContent width */
    47. right: -150px;
    48. background: rgb(231, 105, 2);
    49. }
    50. </style>
    51. <body>
    52. <div id="header">#header</div>
    53. <div id="container">
    54. <div id="center" class="column">#center</div>
    55. <div id="left" class="column">#left</div>
    56. <div id="right" class="column">#right</div>
    57. </div>
    58. <div id="footer">#footer</div>
    59. </body>
    60. </html>
    61. ————————————————
    62. 版权声明:本文为CSDN博主「@Demi」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    63. 原文链接:https://blog.csdn.net/qq_38128179/article/details/86533976