Blogger Information
Blog 18
fans 0
comment 0
visits 10866
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
12.27号作业
- 迷舍人
Original
675 people have browsed it

只要注意好层级关系

效果区

ml代码区

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>移动端</title>
  6. <link rel="stylesheet" href="demo1.css">
  7. <link rel="stylesheet" href="static/font/iconfont.css">
  8. </head>
  9. <body>
  10. <!--头部-->
  11. <header>
  12. <img src="static/images/user.png" alt="">
  13. <img src="static/images/logo.png" alt="">
  14. <img src="static/images/user.png" alt="">
  15. </header>
  16. <!--轮播图-->
  17. <div>
  18. <a href="">
  19. <img src="static/images/1.jpg" alt="">
  20. </a>
  21. </div>
  22. <!--导航区-->
  23. <nav>
  24. <ul>
  25. <li>
  26. <a href="">
  27. <img src="static/images/user.png" alt="">
  28. <span>导航/名字</span>
  29. </a>
  30. </li>
  31. <li>
  32. <a href="">
  33. <img src="static/images/user.png" alt="">
  34. <span>导航/名字</span>
  35. </a>
  36. </li>
  37. <li>
  38. <a href="">
  39. <img src="static/images/user.png" alt="">
  40. <span>导航/名字</span>
  41. </a>
  42. </li>
  43. <li>
  44. <a href="">
  45. <img src="static/images/user.png" alt="">
  46. <span>导航/名字</span>
  47. </a>
  48. </li>
  49. </ul>
  50. <ul>
  51. <li>
  52. <a href="">
  53. <img src="static/images/user.png" alt="">
  54. <span>导航/名字</span>
  55. </a>
  56. </li>
  57. <li>
  58. <a href="">
  59. <img src="static/images/user.png" alt="">
  60. <span>导航/名字</span>
  61. </a>
  62. </li>
  63. <li>
  64. <a href="">
  65. <img src="static/images/user.png" alt="">
  66. <span>导航/名字</span>
  67. </a>
  68. </li>
  69. <li>
  70. <a href="">
  71. <img src="static/images/user.png" alt="">
  72. <span>导航/名字</span>
  73. </a>
  74. </li>
  75. </ul>
  76. </nav>
  77. <!--课程区-->
  78. <main>
  79. <setcion>
  80. <h3>推荐课程</h3>
  81. <div>
  82. <a href="">
  83. <img src="https://img.php.cn/upload/course/000/000/035/5d2941e265889366.jpg" alt="">
  84. </a>
  85. <span>
  86. <a href="">CI框架30分钟极速入门</a>
  87. <span><i>中级</i>55749次播放</span>
  88. </span>
  89. </div>
  90. <div>
  91. <a href="">
  92. <img src="https://img.php.cn/upload/course/000/000/035/5d2941e265889366.jpg" alt="">
  93. </a>
  94. <span>
  95. <a href="">CI框架30分钟极速入门</a>
  96. <span><i>中级</i>55749次播放</span>
  97. </span>
  98. </div>
  99. </setcion>
  100. </main>
  101. <footer>
  102. <a href="">
  103. <i class="iconfont icon-huiyuan2"></i>
  104. <span>首页</span>
  105. </a>
  106. <a href="">
  107. <i class="iconfont icon-huiyuan2"></i>
  108. <span>首页</span>
  109. </a>
  110. <a href="">
  111. <i class="iconfont icon-huiyuan2"></i>
  112. <span>首页</span>
  113. </a>
  114. <a href="">
  115. <i class="iconfont icon-huiyuan2"></i>
  116. <span>首页</span>
  117. </a>
  118. </footer>
  119. </body>
  120. </html>

css代码区

  1. *{
  2. margin: 0;
  3. padding: 0;
  4. /*参考线*/
  5. /*outline: 1px red dashed;*/
  6. }
  7. a {
  8. /*去除下划线*/
  9. text-decoration: none;
  10. color: #222222;
  11. }
  12. li{
  13. /*去除前面的小黑点*/
  14. list-style: none;
  15. }
  16. body{
  17. /*最下宽度*/
  18. min-width: 320px;
  19. /*最大宽度*/
  20. max-width: 768px;
  21. display: flex;
  22. flex-direction: column;
  23. }
  24. /*头部*/
  25. body > header{
  26. height: 8vh;
  27. display: flex;
  28. flex-direction: row;
  29. /*两端对齐*/
  30. justify-content: space-between;
  31. }
  32. /*设置图片大小*/
  33. body > header img{
  34. height: 100%;
  35. }
  36. /*轮播图*/
  37. body > div{
  38. height: 30vh;
  39. }
  40. body > div img{
  41. height: 100%;
  42. width: 100%;
  43. }
  44. /*导航*/
  45. body > nav > ul > li > a >img{
  46. height: 60px;
  47. width: 60px;
  48. }
  49. body > nav > ul{
  50. display: flex;
  51. justify-content: space-around;
  52. background-color: #888888;
  53. }
  54. body > nav > ul > li > a {
  55. margin-top: 1vh;
  56. display: flex;
  57. flex-direction: column;
  58. }
  59. /*课程区*/
  60. body > main > setcion >h3{
  61. color: #666666;
  62. margin-left: 1vh;
  63. }
  64. body > main > setcion >div{
  65. display: flex;
  66. flex-direction: row;
  67. }
  68. body > main > setcion > div > a > img{
  69. width: 300px;
  70. height: 150px;
  71. }
  72. body > main > setcion > div > span{
  73. flex-grow: 1;
  74. display: flex;
  75. flex-direction: column;
  76. }
  77. body > main > setcion > div > span > span > i{
  78. background-color: #bd2c00;
  79. }
  80. body > main > setcion > div > span > span{
  81. margin-top: auto;
  82. }
  83. body > main > setcion > div > span > span{
  84. display: flex;
  85. /*两端对齐*/
  86. justify-content: space-between;
  87. }
  88. /*尾部*/
  89. body > footer{
  90. height: 8vh;
  91. display: flex;
  92. flex-direction: row;
  93. justify-content: space-around;
  94. }
  95. body > footer > a{
  96. margin-top: 1vh;
  97. display: flex;
  98. flex-direction: column;
  99. }
  100. body > footer > a > i{
  101. font-size: 20px !important;
  102. }
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