Blogger Information
Blog 7
fans 0
comment 1
visits 4248
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1027作业 :按自己想法完善pc端的布局页面(不要求细节)
Vic
Original
561 people have browsed it

pc端的布局页面


代码如下:

  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. *{
  9. box-sizing: border-box;
  10. margin: 0;
  11. padding: 0;
  12. }
  13. body{
  14. display: flex;
  15. flex-flow: column nowrap;
  16. }
  17. a{
  18. text-decoration: none;
  19. }
  20. header{
  21. background-color: aquamarine;
  22. display: flex;
  23. flex-flow: row nowrap;
  24. height: 50px;
  25. border: 1px solid black;
  26. }
  27. header > a {
  28. flex: 1 1;
  29. text-align: center;
  30. align-self: center;
  31. }
  32. header > a:last-of-type{
  33. color: chocolate;
  34. }
  35. header > a:hover{
  36. color: crimson;
  37. }
  38. .box {
  39. display: flex;
  40. flex-flow: row nowrap;
  41. min-height: 20em;
  42. justify-content: center;
  43. margin-top: 3em;
  44. margin-bottom: 3em;
  45. }
  46. aside, main{
  47. border: 1px solid;
  48. text-align: center;
  49. }
  50. aside{
  51. flex: 0 0 10em;
  52. }
  53. main{
  54. flex: 0 0 30em;
  55. margin-left: 2em;
  56. margin-right: 2em;
  57. }
  58. footer{
  59. background-color: aquamarine;
  60. display: flex;
  61. flex-flow: column nowrap;
  62. /* height: 80px; */
  63. border: 1px solid black;
  64. justify-content: center;
  65. align-items: center;
  66. }
  67. footer > p{
  68. }
  69. @media screen and (max-width:880px){
  70. .box{
  71. flex-flow: column wrap;
  72. }
  73. aside{
  74. flex: 0 0 5em;
  75. margin-left: 2em;
  76. margin-right: 2em;
  77. }
  78. main{
  79. flex: 0 0 20em;
  80. }
  81. }
  82. /* @media screen and (max-width:700px){
  83. .box{
  84. flex-flow: column wrap;
  85. }
  86. } */
  87. </style>
  88. </head>
  89. <body>
  90. <header>
  91. <a href="">LOGO</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="box">
  100. <aside>左侧栏</aside>
  101. <main>主栏</main>
  102. <aside>右侧栏</aside>
  103. </div>
  104. <footer>
  105. <p>php中文网:公益在线php培训,帮助PHP学习者快速成长!</p>
  106. <p>Copyright 2014-2020 https://www.php.cn/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1</p>
  107. </footer>
  108. </body>
  109. </html>

效果如下:

情况1:当浏览器宽度>880px时,画面如图:



情况2:当浏览器宽度<880px时,画面如图:


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