Blogger Information
Blog 4
fans 0
comment 0
visits 2281
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
前端学习-1227号作业
Original
526 people have browsed it

1227号作业

效果图展示

HTML代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="moblie.css">
  6. <title>移动端布局</title>
  7. </head>
  8. <body>
  9. <div class="header">
  10. <a href="" ><img src="static/images/ico/login.png" alt=""></a>
  11. <a href="" ><img src="static/images/ico/logo.png" alt=""></a>
  12. <a href="" ><img src="static/images/ico/login.png" alt=""></a>
  13. </div>
  14. <div class="main">
  15. <div class="banner">
  16. <img src="static/images/ico/2.jpg" alt="">
  17. </div>
  18. <div class="nav-1">
  19. <div class="nav-list">
  20. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  21. <span>HTML/CSS</span>
  22. </div>
  23. <div class="nav-list">
  24. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  25. <span>HTML/CSS</span>
  26. </div>
  27. <div class="nav-list">
  28. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  29. <span>HTML/CSS</span>
  30. </div>
  31. <div class="nav-list">
  32. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  33. <span>HTML/CSS</span>
  34. </div>
  35. </div>
  36. <div class="nav-2">
  37. <div class="nav-list">
  38. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  39. <span>HTML/CSS</span>
  40. </div>
  41. <div class="nav-list">
  42. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  43. <span>HTML/CSS</span>
  44. </div>
  45. <div class="nav-list">
  46. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  47. <span>HTML/CSS</span>
  48. </div>
  49. <div class="nav-list">
  50. <a href=""><img src="static/images/ico/html.png" alt=""></a>
  51. <span>HTML/CSS</span>
  52. </div>
  53. </div>
  54. <div class="article">
  55. <div class="section-tuijian">
  56. <h3>推荐视频</h3>
  57. <div class="banner-1">
  58. <a href=""><img src="static/images/ico/tian.jpg" alt=""></a>
  59. <a href=""><img src="static/images/ico/tian.jpg" alt=""></a>
  60. </div>
  61. <div class="banner-2">
  62. <div class="banner-list">
  63. <a href=""><img src="static/images/ico/HTML5.jpg" alt=""></a>
  64. <div class="banner-list-intro">
  65. <a href="">CI框架30分钟极速入门</a>
  66. <div>
  67. <span>中级</span>
  68. <span>56179次播放</span>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="banner-list">
  73. <a href=""><img src="static/images/ico/HTML5.jpg" alt=""></a>
  74. <div class="banner-list-intro">
  75. <a href="">2018前端入门_HTML5</a>
  76. <div>
  77. <span>初级</span>
  78. <span>56179次播放</span>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="section-new-update">
  85. <h3>最新更新</h3>
  86. <div class="banner-list">
  87. <a href=""><img src="static/images/ico/new1.png" alt=""></a>
  88. <div class="banner-list-intro">
  89. <a href="">PHP快速操控Excel之PhpSpreadsheet</a>
  90. <span>老的PHPExcel已经停止更新了!目前最新的是使用phpOffice插件PhpSpreadshe...</span>
  91. <div>
  92. <span>中级</span>
  93. <span>56179次播放</span>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="section-new-article">
  99. <h3>最新文章</h3>
  100. <div class="banner-list-intro">
  101. <div>
  102. <a href="" >如何设置vscode打开文件时新建窗口</a>
  103. <a href="" >发布时间:2019-12-30</a>
  104. </div>
  105. <div class="banner-list">
  106. <a href=""><img src="static/images/ico/art1.jpg" alt=""></a>
  107. </div>
  108. </div>
  109. <a href="">更多内容</a>
  110. </div>
  111. <div class="section-new-bowen">
  112. <h3>最新博文</h3>
  113. <div>
  114. <a href="">php核心特性 - 错误处理</a>
  115. <span>2020年01月04日</span>
  116. </div>
  117. <a href="">更多内容</a>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="footer">
  122. <div>
  123. <a href="" >
  124. <img src="static/images/ico/login.png" alt="">首页
  125. </a>
  126. </div>
  127. <div>
  128. <a href="" >
  129. <img src="static/images/ico/login.png" alt="">登录
  130. </a>
  131. </div>
  132. <div>
  133. <a href="" >
  134. <img src="static/images/ico/login.png" alt="">视频
  135. </a>
  136. </div>
  137. <div>
  138. <a href="" >
  139. <img src="static/images/ico/login.png" alt="">其他
  140. </a>
  141. </div>
  142. </div>
  143. </body>
  144. </html>

CSS代码

  1. @import "public_reset.css";
  2. body{
  3. width: 768px;
  4. /*height: 100vh;*/
  5. }
  6. body > .main {
  7. flex: 1;
  8. /*超出页面显示,增加滚动条*/
  9. overflow: auto;
  10. display: flex;
  11. flex-direction: column;
  12. }
  13. /*头部样式*/
  14. body > .header{
  15. display: flex;
  16. height: 42px;
  17. background-color: black;
  18. justify-content: space-between;
  19. }
  20. body > .header > a{
  21. display: flex;
  22. width: 25px;
  23. height: 25px;
  24. align-self: center;
  25. }
  26. body > .header > a:nth-child(2) {
  27. width: auto;
  28. height: 42px;
  29. }
  30. /*轮播图样式*/
  31. body > .main >.banner > img{
  32. display: flex;
  33. width: 768px;
  34. height: 150px;
  35. }
  36. /*导航栏样式*/
  37. body > .main > .nav-1{
  38. display: flex;
  39. flex-flow: row wrap;
  40. justify-content: space-evenly;
  41. background-color: white;
  42. }
  43. body > .main > .nav-2{
  44. display: flex;
  45. flex-flow: row wrap;
  46. justify-content: space-evenly;
  47. padding-bottom: 10px;
  48. background-color: white;
  49. }
  50. body > .main > .nav-1 > .nav-list{
  51. display: flex;
  52. flex-flow: column;
  53. justify-content: space-evenly;
  54. }
  55. body > .main >.nav-2 > .nav-list{
  56. display: flex;
  57. flex-flow: column;
  58. justify-content: space-evenly;
  59. }
  60. body > .main > .nav-1 > .nav-list > a{
  61. display: flex;
  62. width: 45px;
  63. height: 49px;
  64. align-self: center;
  65. margin: 10px 0;
  66. }
  67. body > .main > .nav-2 > .nav-list > a{
  68. display: flex;
  69. width: 45px;
  70. height: 49px;
  71. align-self: center;
  72. margin: 10px 0;
  73. }
  74. body > .main > .nav-1 > .nav-list span{
  75. text-align: center;
  76. }
  77. body > .main > .nav-2 > .nav-list span{
  78. text-align: center;
  79. }
  80. /*推荐视频样式*/
  81. body > .main > .article > .section-tuijian{
  82. display: flex;
  83. flex-direction: column;
  84. margin: 20px 0;
  85. padding: 0 10px;
  86. }
  87. body > .main > .article > .section-tuijian h3{
  88. padding-bottom: 10px;
  89. }
  90. body > .main > .article > .section-tuijian > .banner-1{
  91. display: flex;
  92. justify-content: space-between;
  93. }
  94. body > .main > .article > .section-tuijian > .banner-1 > a{
  95. display: flex;
  96. }
  97. body > .main > .article > .section-tuijian > .banner-1 > a img{
  98. height: 90px;
  99. width: 366px;
  100. }
  101. body > .main > .article > .section-tuijian > .banner-list{
  102. display: flex;
  103. flex-direction: row;
  104. }
  105. body > .main > .article > .section-tuijian > .banner-2{
  106. display: flex;
  107. flex-direction: column;
  108. }
  109. body > .main > .article > .section-tuijian > .banner-2> .banner-list{
  110. display: flex;
  111. margin: 10px 0;
  112. padding: 10px;
  113. background-color: white;
  114. }
  115. body > .main > .article > .section-tuijian > .banner-2> .banner-list > a{
  116. display: flex;
  117. }
  118. body > .main > .article > .section-tuijian > .banner-2> .banner-list > a img{
  119. width: 295px;
  120. height: 80px;
  121. }
  122. body > .main > .article > .section-tuijian > .banner-2> .banner-list > .banner-list-intro{
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: start;
  126. margin-left: 20px;
  127. flex: 1;
  128. }
  129. body > .main > .article > .section-tuijian > .banner-2> .banner-list > .banner-list-intro > div{
  130. display: flex;
  131. margin-top: 20px;
  132. }
  133. body > .main > .article > .section-tuijian > .banner-2> .banner-list > .banner-list-intro > div a{
  134. font-size: 20px;
  135. height: 50px;
  136. }
  137. body > .main > .article > .section-tuijian > .banner-2> .banner-list > .banner-list-intro > div span:first-of-type{
  138. background-color: black;
  139. color: white;
  140. border-radius: 5px;
  141. margin-right: 5px;
  142. }
  143. /*更新文章样式*/
  144. body > .main > .article > .section-new-update{
  145. display: flex;
  146. flex-direction: column;
  147. margin: 20px 0;
  148. padding: 0 10px;
  149. }
  150. body > .main > .article > .section-new-update h3{
  151. padding-bottom: 10px;
  152. }
  153. body > .main > .article > .section-new-update > .banner-list{
  154. display: flex;
  155. padding: 10px;
  156. background-color: white;
  157. }
  158. body > .main > .article > .section-new-update > .banner-list >.banner-list-intro{
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: space-between;
  162. margin-left: 20px;
  163. }
  164. body > .main > .article > .section-new-update > .banner-list >.banner-list-intro > div{
  165. display: flex;
  166. justify-content: space-between;
  167. }
  168. body > .main > .article > .section-new-update > .banner-list >.banner-list-intro > div > span:first-of-type{
  169. background-color: black;
  170. border-radius: 5px;
  171. color: white;
  172. }
  173. body > .main > .article > .section-new-update > .banner-list > a{
  174. display: flex;
  175. }
  176. body > .main > .article > .section-new-update > .banner-list > a img{
  177. width: 295px;
  178. height: 80px;
  179. }
  180. /*最新文章样式*/
  181. body > .main > .article > .section-new-article{
  182. display: flex;
  183. flex-direction: column;
  184. margin: 20px 0;
  185. padding: 0 10px;
  186. }
  187. body > .main > .article > .section-new-article > h3{
  188. padding-bottom: 10px;
  189. }
  190. body > .main > .article > .section-new-article > .banner-list-intro{
  191. display: flex;
  192. justify-content: space-between;
  193. padding: 10px;
  194. background-color: white;
  195. }
  196. body > .main > .article > .section-new-article > .banner-list-intro > div{
  197. display: flex;
  198. flex-direction: column;
  199. }
  200. body > .main > .article > .section-new-article > .banner-list-intro > div a{
  201. font-size: 15px;
  202. }
  203. body > .main > .article > .section-new-article > .banner-list-intro > div > a:first-of-type{
  204. font-size: 15px;
  205. font-weight: 900;
  206. }
  207. body > .main > .article > .section-new-article > .banner-list-intro > div > a:last-of-type{
  208. padding-top: 10px;
  209. box-sizing: border-box;
  210. }
  211. body > .main > .article > .section-new-article > .banner-list-intro > .banner-list > a img{
  212. display: flex;
  213. width: 219px;
  214. height: 65px;
  215. }
  216. body > .main > .article > .section-new-article > a{
  217. text-align: center;
  218. background-color: #fff;
  219. margin: 10px 0;
  220. }
  221. /*最新博文样式*/
  222. body > .main > .article > .section-new-bowen {
  223. display: flex;
  224. flex-direction: column;
  225. padding: 10px;
  226. }
  227. body > .main > .article > .section-new-bowen > h3{
  228. padding: 10px;
  229. }
  230. body > .main > .article > .section-new-bowen > div{
  231. display: flex;
  232. justify-content: space-between;
  233. padding: 10px;
  234. background-color: #fff;
  235. }
  236. body > .main > .article > .section-new-bowen > a{
  237. text-align: center;
  238. background-color: #fff;
  239. margin: 10px 0;
  240. }
  241. /*底部样式*/
  242. body > .footer{
  243. display: flex;
  244. justify-content: space-around;
  245. border-top: 1px gray solid;
  246. }
  247. body > .footer > div{
  248. display: flex;
  249. flex-direction: column;
  250. text-align: center;
  251. }
  252. body > .footer > div > a{
  253. display: flex;
  254. flex-direction: column;
  255. width: 45px;
  256. height: 49px;
  257. font-size: 15px;
  258. padding-top: 10px;
  259. }

在布局样式的时候,我添加了滚动条,但是一直没有出现,也百度了一下,现在还没有解决,没有找到问题所在。。。

老师,css和html应该也存在加载效率的问题吧?我总是感觉我写的东西不是最优的方案,感觉我的代码很冗余。哈哈。。。

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:别担心代码冗余, 随着网速越来越快, 特别是5G时代的到来, 这些都不再是关注的重点, 除了极端环境
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