博客列表 >CCS3:PHP中文网移动版

CCS3:PHP中文网移动版

づ太依赖
づ太依赖原创
2020年04月12日 23:33:14667浏览

实现代码

  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. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>php中文网</title>
  8. <link rel="stylesheet" href="font/font.css">
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. a {
  15. text-decoration: none;
  16. color: #666;
  17. }
  18. html {
  19. /* vw: 可视区宽度,100vw:表示占满100份 */
  20. width: 100vw;
  21. height: 100vh;
  22. /* 在html中设置字体大小, 给后的rem单位用 */
  23. font-size: 14px;
  24. }
  25. body {
  26. min-width: 360px;
  27. background-color: #fff;
  28. display: flex;
  29. flex-flow: column nowrap;
  30. }
  31. header {
  32. display: flex;
  33. top: 0;
  34. background-color: #2d353c;
  35. height: 50px;
  36. box-sizing: border-box;
  37. align-items: center;
  38. justify-content: space-between;
  39. padding: 0 20px;
  40. /* width: 90vw; */
  41. line-height: 50px;
  42. /* width: 100%; */
  43. }
  44. header>p {
  45. color: rgb(250, 249, 249);
  46. }
  47. header>span {
  48. color: aliceblue;
  49. font-size: 20px;
  50. /* padding-right: 5%; */
  51. }
  52. .banner img {
  53. width: 100%;
  54. }
  55. /* 导航区 */
  56. nav {
  57. height: 100px;
  58. display: flex;
  59. flex-flow: row wrap;
  60. }
  61. nav>div {
  62. width: 25vw;
  63. display: flex;
  64. flex-flow: column nowrap;
  65. align-items: center;
  66. }
  67. /* 推荐课程 */
  68. .kc1 {
  69. display: flex;
  70. flex-flow: row nowrap;
  71. }
  72. .kc1 img {
  73. width: 98%;
  74. box-sizing: border-box;
  75. flex: 1 0 50%;
  76. align-items: center;
  77. }
  78. footer {
  79. position: fixed;
  80. bottom: 0;
  81. width: 100%;
  82. height: 55px;
  83. display: flex;
  84. justify-content: space-around;
  85. background-color: cornsilk;
  86. }
  87. .gx {
  88. display: flex;
  89. padding: 5px 4px;
  90. box-sizing: border-box;
  91. justify-items: center;
  92. flex-flow: row nowrap;
  93. }
  94. .gx>a {
  95. display: flex;
  96. height: 100px;
  97. }
  98. .gx img {
  99. width: 100%;
  100. }
  101. footer>div>a {
  102. display: flex;
  103. width: 25vw;
  104. flex-flow: column nowrap;
  105. align-items: center;
  106. border-top: 1px solid rgb(79, 79, 80);
  107. }
  108. </style>
  109. </head>
  110. <body>
  111. <!-- 头部 -->
  112. <header>
  113. <a href="">头像</a>
  114. <p>PHP中文网</p>
  115. <span class="iconfont">&#xe67d;</span>
  116. </header>
  117. <!-- 轮播图 -->
  118. <div class="banner">
  119. <img src="images/lb1.png" alt="">
  120. </div>
  121. <!-- 导航区 -->
  122. <nav>
  123. <div>
  124. <a href=""><span class="iconfont">&#xe632;</span></a>
  125. <a href="">html</a>
  126. </div>
  127. <div>
  128. <a href=""><span class="iconfont">&#xe632;</span></a>
  129. <a href="">html</a>
  130. </div>
  131. <div>
  132. <a href=""><span class="iconfont">&#xe632;</span></a>
  133. <a href="">html</a>
  134. </div>
  135. <div>
  136. <a href=""><span class="iconfont">&#xe632;</span></a>
  137. <a href="">html</a>
  138. </div>
  139. <div>
  140. <a href=""><span class="iconfont">&#xe632;</span></a>
  141. <a href="">html</a>
  142. </div>
  143. <div>
  144. <a href=""><span class="iconfont">&#xe632;</span></a>
  145. <a href="">html</a>
  146. </div>
  147. <div>
  148. <a href=""><span class="iconfont">&#xe632;</span></a>
  149. <a href="">html</a>
  150. </div>
  151. <div>
  152. <a href=""><span class="iconfont">&#xe632;</span></a>
  153. <a href="">html</a>
  154. </div>
  155. </nav>
  156. <hr>
  157. <!-- 推荐课程 -->
  158. <h2 class="title">
  159. 推荐课程
  160. </h2>
  161. <div class="kc1">
  162. <div>
  163. <a href=""><img src="images/ke2.jpg" alt=""></a>
  164. </div>
  165. <div>
  166. <a href=""><img src="images/kc1.jpg" alt=""></a>
  167. </div>
  168. </div>
  169. <!-- 最新更新 -->
  170. <h2>最新课程</h2>
  171. <div class="gxs">
  172. <div class="gx">
  173. <a href=""><img src="images/py1.jpg" alt=""></a>
  174. <a>2019年python自学视频</a>
  175. </div>
  176. </div>
  177. <div class="gxs">
  178. <div class="gx">
  179. <a href=""><img src="images/py1.jpg" alt=""></a>
  180. <a>2019年python自学视频</a>
  181. </div>
  182. </div>
  183. <div class="gxs">
  184. <div class="gx">
  185. <a href=""><img src="images/py1.jpg" alt=""></a>
  186. <a>2019年python自学视频</a>
  187. </div>
  188. </div>
  189. <!-- 最新文章 -->
  190. <div></div>
  191. <!-- 更多内容 -->
  192. <div class="gd">更多内容</div>
  193. <!-- 尾部 -->
  194. <footer>
  195. <div>
  196. <a href=""> <span class="iconfont">&#xe723;</span>
  197. <span>首页</span></a>
  198. </div>
  199. <div>
  200. <a href=""><span class="iconfont">&#xe60d;</span>
  201. <span>视频</span>
  202. </a>
  203. </div>
  204. <div>
  205. <a href=""><span class="iconfont">&#xe62e;</span>
  206. <span>社区</span>
  207. </a>
  208. </div>
  209. <div>
  210. <a href="">
  211. <span class="iconfont">&#xe621;</span>
  212. <span>我的</span>
  213. </a>
  214. </div>
  215. </footer>
  216. </body>
  217. </html>

总结

刚开始做 错误频频
反复回看视频,理解知识

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议