博客列表 >仿php.cn手机端

仿php.cn手机端

新手1314
新手1314原创
2022年07月19日 17:49:37553浏览

html:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>防php中文网手机端</title>
  8. <link rel="stylesheet" href="css/reset.css" />
  9. <link rel="stylesheet" href="//at.alicdn.com/t/font_3280782_az0e3d2vvfl.css" />
  10. <link rel="stylesheet" href="css/header.css" />
  11. <link rel="stylesheet" href="css/main.css" />
  12. <link rel="stylesheet" href="css/footer.css" />
  13. </head>
  14. <body>
  15. <header>
  16. <div class="head">
  17. <div><img src="images/user.jpg" alt="" class="touxiang" /></div>
  18. <div><img src="images/logo.png" alt="" class="logo" /></div>
  19. <div>
  20. <img src="images/php.png" alt="" class="php" />
  21. <span class="iconfont icon-spread-left"></span>
  22. </div>
  23. </div>
  24. </header>
  25. <div><img src="images/lunbo.jpg" alt="" class="lunbo" /></div>
  26. <main>
  27. <div class="main">
  28. <div class="list">
  29. <a href=""><img src="images/html.png" alt="" /></a>
  30. <a href="" class="ziti">HTML/CSS</a>
  31. </div>
  32. <div class="list">
  33. <a href=""><img src="images/JavaScript.png" alt="" /></a>
  34. <a href="" class="ziti">JavaScript</a>
  35. </div>
  36. <div class="list">
  37. <a href=""><img src="images/code.png" alt="" /></a>
  38. <a href="" class="ziti">服务器</a>
  39. </div>
  40. <div class="list">
  41. <a href=""><img src="images/sql.png" alt="" /></a>
  42. <a href="" class="ziti">数据库</a>
  43. </div>
  44. <div class="list">
  45. <a href=""><img src="images/app.png" alt="" /></a>
  46. <a href="" class="ziti">移动端</a>
  47. </div>
  48. <div class="list">
  49. <a href=""><img src="images/shouce.png" alt="" /></a>
  50. <a href="" class="ziti">手册</a>
  51. </div>
  52. <div class="list">
  53. <a href=""><img src="images/gongju.png" alt="" /></a>
  54. <a href="" class="ziti">工具</a>
  55. </div>
  56. <div class="list">
  57. <a href=""><img src="images/live.png" alt="" /></a>
  58. <a href="" class="ziti">直播</a>
  59. </div>
  60. </div>
  61. <div class="tuijian">
  62. <h3>推荐课程</h3>
  63. <div>
  64. <img src="images/tp.png" alt="" />
  65. <img src="images/tp6.png" alt="" />
  66. </div>
  67. <div class="clear">
  68. <div><img src="images/php8.png" alt="" /></div>
  69. <div class="zi">
  70. <h2><a href="">php8,我来也</a></h2>
  71. <p>
  72. <span class="jishu">初级</span>
  73. <span>171357次播放</span>
  74. </p>
  75. </div>
  76. <div><img src="images/2021php.png" alt="" /></div>
  77. <div class="zi">
  78. <h2><a href="">细说php(2021版)第一季</a></h2>
  79. <p>
  80. <span class="jishu">中级</span>
  81. <span>154426次播放</span>
  82. </p>
  83. </div>
  84. </div>
  85. </div>
  86. </main>
  87. <footer>
  88. <div class="item active">
  89. <a href="" class="iconfont icon-shouye"></a>
  90. <a href="">首页</a>
  91. </div>
  92. <div class="item">
  93. <a href="" class="iconfont icon-shipin1x"></a>
  94. <a href="">视频</a>
  95. </div>
  96. <div class="item">
  97. <a href=""><img src="images/gif_live.gif" alt="" /></a>
  98. <a href="" class="font-px">培训</a>
  99. </div>
  100. <div class="item">
  101. <a href="" class="iconfont icon-code-circle"></a>
  102. <a href="">社区</a>
  103. </div>
  104. <div class="item">
  105. <a href="" class="iconfont icon-31wode"></a>
  106. <a href="">我的</a>
  107. </div>
  108. </footer>
  109. </body>
  110. </html>

css:

  1. reset.css:
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. a {
  8. text-decoration: none;
  9. color: #666;
  10. }
  11. li {
  12. list-style: none;
  13. }
  14. html {
  15. font-size: calc(100vw / 3.75);
  16. }
  17. body {
  18. font-size: 0.12rem;
  19. color: #333;
  20. max-width: 750px;
  21. min-width: 320px;
  22. margin: auto;
  23. background-color: #f4f4f4;
  24. }
  25. @media (max-width: 320px) {
  26. html {
  27. font-size: 85px;
  28. }
  29. }
  30. @media (min-width: 640px) {
  31. html {
  32. font-size: 170px;
  33. }
  34. }
  35. footer.css:
  36. footer {
  37. display: grid;
  38. grid-template-columns: repeat(5, 1fr);
  39. background-color: #f4f4f4;
  40. width: 100vw;
  41. height: 0.52rem;
  42. position: fixed;
  43. bottom: 0;
  44. left: 0;
  45. right: 0;
  46. border-top: 1px solid #ccc;
  47. grid-template-rows: 0.52rem;
  48. }
  49. footer .item {
  50. text-align: center;
  51. }
  52. footer .item.active {
  53. text-align: center;
  54. }
  55. footer .item.active a {
  56. /* padding-top: 10px; */
  57. color: red;
  58. /* padding: 0.05rem 0; */
  59. display: block;
  60. /* width: 20%; */
  61. line-height: 0.2rem;
  62. font-weight: bold;
  63. /* font-size: 16px; */
  64. }
  65. footer .item.active .iconfont {
  66. margin-top: 0.05rem;
  67. font-size: 0.16rem;
  68. }
  69. footer .item .iconfont {
  70. margin-top: 0.05rem;
  71. font-size: 0.16rem;
  72. }
  73. footer .item a {
  74. display: block;
  75. line-height: 0.2rem;
  76. font-weight: bold;
  77. }
  78. footer .item a img {
  79. margin-top: 0.05rem;
  80. width: 25%;
  81. height: 50%;
  82. }
  83. footer .item .font-px {
  84. margin-top: -4px;
  85. display: block;
  86. font-weight: bold;
  87. }
  88. header.css:
  89. header .head {
  90. display: grid;
  91. grid-template-columns: repeat(3, 1fr);
  92. background-color: #2d353c;
  93. /* height: 40px; */
  94. grid-template-rows: 0.42rem;
  95. }
  96. header .touxiang {
  97. margin-left: 0.05rem;
  98. margin-top: 0.07rem;
  99. width: 0.23rem;
  100. height: 0.23rem;
  101. border-radius: 50%;
  102. }
  103. header .logo {
  104. margin-left: 0.12rem;
  105. width: 0.93rem;
  106. height: 0.45rem;
  107. }
  108. header .php {
  109. margin-top: 0.12rem;
  110. width: 0.7rem;
  111. height: auto;
  112. }
  113. header .iconfont {
  114. margin-top: 0.1rem;
  115. float: right;
  116. margin-right: 0.15rem;
  117. color: white;
  118. font-size: 0.19rem;
  119. place-items: center center;
  120. }
  121. .lunbo {
  122. height: 1.5rem;
  123. width: 100%;
  124. }
  125. main.css:
  126. main .main {
  127. display: grid;
  128. height: 1.7rem;
  129. background-color: white;
  130. grid-template-columns: repeat(4, 1fr);
  131. grid-template-rows: repeat(2, 1fr);
  132. }
  133. main .main .list {
  134. display: grid;
  135. margin-top: 0.1rem;
  136. text-align: center;
  137. }
  138. main .main .list img {
  139. width: 0.45rem;
  140. height: 0.45rem;
  141. }
  142. main .main .list .ziti {
  143. margin-top: -10px;
  144. font-weight: bold;
  145. font-size: 14px;
  146. /* color: darkgray; */
  147. color: slategray;
  148. }
  149. main .tuijian {
  150. margin-top: 0.2rem;
  151. padding: 0.1rem 0.1rem 0.1rem;
  152. }
  153. main .tuijian h3 {
  154. display: block;
  155. padding-bottom: 0.1rem;
  156. font-size: 0.18rem;
  157. font-weight: bold;
  158. }
  159. main .tuijian img {
  160. margin-bottom: 0.2rem;
  161. height: 0.85rem;
  162. width: 49%;
  163. }
  164. main .tuijian .clear {
  165. display: grid;
  166. background-color: #fff;
  167. height: 2.1rem;
  168. grid-template-columns: 1.6rem 1.95rem;
  169. grid-template-rows: repeat(2, 1fr);
  170. }
  171. main .tuijian .clear img {
  172. margin: 10px;
  173. /* padding: 10px; */
  174. width: 1.38rem;
  175. height: 0.8rem;
  176. }
  177. main .tuijian .clear .zi {
  178. /* margin: 10px; */
  179. padding-top: 0.1rem;
  180. }
  181. main .tuijian .clear .zi h2 a {
  182. font-weight: 400;
  183. font-size: 0.17rem;
  184. color: #888;
  185. }
  186. main .tuijian .clear .zi p {
  187. padding-top: 10px;
  188. }
  189. main .tuijian .clear .zi p .jishu {
  190. background-color: #595757;
  191. border-radius: 0.08rem;
  192. color: #fff;
  193. font-size: 0.1rem;
  194. padding: 0.02rem;
  195. }
上一条:0718京东下一条:移动布局仿JD
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议