Blogger Information
Blog 21
fans 0
comment 0
visits 21418
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
pc端页面布局 自己添加内容
N.
Original
636 people have browsed it

html代码:

  1. <!DOCTYPE html>
  2. <html lang="">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>模仿案例布局</title>
  7. <style>
  8. * {
  9. box-sizing: border-box;
  10. text-decoration: none;
  11. margin: 0;
  12. padding: 0;
  13. }
  14. a {
  15. color: black;
  16. font-weight: 700;
  17. }
  18. header,
  19. footer {
  20. border: 1px solid #000;
  21. height: 3em;
  22. }
  23. header {
  24. display: flex;
  25. align-items: center;
  26. background-color: dimgrey;
  27. font-size: 1.3em;
  28. }
  29. header > a {
  30. flex: 0 1 8em;
  31. text-align: center;
  32. }
  33. header > a:nth-of-type(6) {
  34. margin-left: auto;
  35. }
  36. .box {
  37. display: flex;
  38. flex-flow: column nowrap;
  39. min-width: 35em;
  40. }
  41. header > a:hover:not(:first-of-type) {
  42. color: darkred;
  43. }
  44. .box1 {
  45. min-height: 45em;
  46. display: flex;
  47. justify-content: center;
  48. padding-top: 1em;
  49. }
  50. .box1 > aside,
  51. .box1 > main {
  52. border: 1px solid #000;
  53. }
  54. .box1 > aside {
  55. flex: 0 0 10em;
  56. }
  57. .box1 > main {
  58. flex: 0 0 30em;
  59. }
  60. footer {
  61. display: flex;
  62. flex-flow: column;
  63. text-align: center;
  64. }
  65. .box2 {
  66. display: flex;
  67. flex-flow: column;
  68. justify-content: center;
  69. height: 25em;
  70. padding-left: 1.5em;
  71. justify-content: space-around;
  72. margin-right: 0.7em;
  73. background-color: slategray;
  74. border-radius: 0.7em;
  75. margin-left: 0.7em;
  76. }
  77. li {
  78. flex: auto;
  79. list-style: none;
  80. font-size: 1.5em;
  81. font-weight: 800;
  82. }
  83. </style>
  84. </head>
  85. <body>
  86. <div class="box">
  87. <header>
  88. <div>
  89. <img src="https://www.php.cn/static/images/logo.png " />
  90. </div>
  91. <a href="">首页</a>
  92. <a href="">咨询</a>
  93. <a href="">朋友圈</a>
  94. <a href="">社区</a>
  95. <a href="">工具</a>
  96. <a href="">登录</a>
  97. <a href="">客户端下载</a>
  98. </header>
  99. <div class="box1">
  100. <aside class="box2">
  101. <a href=""><li>PHP开发</li></a>
  102. <a href=""><li>前端开发</li></a>
  103. <a href=""><li>后端开发</li></a>
  104. <a href=""><li>服务器开发</li></a>
  105. <a href=""><li>数据库</li></a>
  106. <a href=""><li>移动端</li></a>
  107. </aside>
  108. <main>
  109. <img src="https://img.php.cn/upload/article/000/000/003/5f5add2bab403839.png" alt="" />
  110. </main>
  111. <aside class="box2">
  112. <a href=""><li>服务器运维</li></a>
  113. <a href=""><li>常用类库</li></a>
  114. <a href=""><li>在线工具箱</li></a>
  115. <a href=""><li>移动端开发</li></a>
  116. <a href=""><li>数据库</li></a>
  117. <a href=""><li>移动端</li></a>
  118. </aside>
  119. </div>
  120. <footer>
  121. <p>河南省郑州市高新区科学大道金梭路玉兰街</p>
  122. <p>河南省郑州市高新区科学大道金梭路玉兰街</p>
  123. </footer>
  124. </div>
  125. </body>
  126. </html>

效果图:

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:这么少的代码量, 就能布局出这个页面, 非常 不错的
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post