Blogger Information
Blog 62
fans 3
comment 1
visits 29686
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿制淘宝移动端首页
kiraseo_wwwkiraercom
Original
451 people have browsed it

仿制淘宝首页

效果图

代码如下

  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. <link rel="stylesheet" href="css/index.css">
  8. <title>移动端首页布局</title>
  9. </head>
  10. <body>
  11. <!-- 页眉 -->
  12. <header>
  13. <a href="" class="logo"><img src="image/taobao.png" alt=""></a>
  14. <a href="" class="search">
  15. <span>寻找宝贝店铺</span>
  16. <span>搜索</span>
  17. </a>
  18. <a href="" class="qiandao"><img src="image/qiandao.png"></a>
  19. </header>
  20. <!-- 主体 -->
  21. <main>
  22. <!-- 1。顶部导航 -->
  23. <ul class="navs">
  24. <li class="item" onclick="">
  25. <a href=""><img src="images/navs/tmxb.webp" alt="" /></a>
  26. <a href="">天猫新品</a>
  27. </li>
  28. <li class="item">
  29. <a href=""><img src="images/navs/jrbk.webp" alt="" /></a>
  30. <a href="">今日爆款</a>
  31. </li>
  32. <li class="item">
  33. <a href=""><img src="images/navs/tmgj.webp" alt="" /></a>
  34. <a href="">天猫国际</a>
  35. </li>
  36. <li class="item">
  37. <a href=""><img src="images/navs/fzlx.webp" alt="" /></a>
  38. <a href="">飞猪旅行</a>
  39. </li>
  40. <li class="item">
  41. <a href=""><img src="images/navs/tmcx.webp" alt="" /></a>
  42. <a href="">天猫超市</a>
  43. </li>
  44. <li class="item">
  45. <a href=""><img src="images/navs/tbch.webp" alt="" /></a>
  46. <a href="">淘宝吃货</a>
  47. </li>
  48. <li class="item">
  49. <a href=""><img src="images/navs/sqk.webp" alt="" /></a>
  50. <a href="">省钱卡</a>
  51. </li>
  52. <li class="item">
  53. <a href=""><img src="images/navs/ltjb.webp" alt="" /></a>
  54. <a href="">领淘金币</a>
  55. </li>
  56. <li class="item">
  57. <a href=""><img src="images/navs/alpm.webp" alt="" /></a>
  58. <a href="">阿里拍卖</a>
  59. </li>
  60. <li class="item">
  61. <a href=""><img src="images/navs/fl.webp" alt="" /></a>
  62. <a href="">分类</a>
  63. </li>
  64. </ul>
  65. <!-- 2 快捷入口 -->
  66. <ul class="entry">
  67. <li class="item">
  68. <div class="title">
  69. <h3>聚划算</h3>
  70. <span>品牌折扣</span>
  71. </div>
  72. <a href=""><img src="images/items/item-1.webp" alt="" /></a>
  73. <a href=""><img src="images/items/item-2.webp" alt="" /></a>
  74. </li>
  75. <li class="item">
  76. <div class="title">
  77. <h3>天天特卖</h3>
  78. <span>1元秒杀</span>
  79. </div>
  80. <a href=""><img src="images/items/item-3.webp" alt="" /></a>
  81. <a href=""><img src="images/items/item-4.webp" alt="" /></a>
  82. </li>
  83. <li class="item">
  84. <div class="title">
  85. <h3>有好货</h3>
  86. <span style="background-color: deepskyblue">好口碑</span>
  87. </div>
  88. <a href=""><img src="images/items/item-5.webp" alt="" /></a>
  89. <a href=""><img src="images/items/item-6.webp" alt="" /></a>
  90. </li>
  91. <li class="item">
  92. <div class="title">
  93. <h3>每日好店</h3>
  94. <span style="background-color: orange">特色</span>
  95. </div>
  96. <a href=""><img src="images/items/item-7.webp" alt="" /></a>
  97. <a href=""><img src="images/items/item-8.webp" alt="" /></a>
  98. </li>
  99. </ul>
  100. <!-- 3.商品列表 -->
  101. <ul class="list">
  102. <li class="item">
  103. <a href=""><img src="images/items/item-9.webp" alt="" /></a>
  104. <div class="desc">
  105. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  106. <div class="price">
  107. <span class="iconfont icon-renminbi_o">288</span>
  108. <span>123人已购买</span>
  109. </div>
  110. </div>
  111. </li>
  112. <li class="item">
  113. <a href=""><img src="images/items/item-10.webp" alt="" /></a>
  114. <div class="desc">
  115. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  116. <div class="price">
  117. <span class="iconfont icon-renminbi_o">288</span>
  118. <span>123人已购买</span>
  119. </div>
  120. </div>
  121. </li>
  122. <li class="item">
  123. <a href=""><img src="images/items/item-11.webp" alt="" /></a>
  124. <div class="desc">
  125. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  126. <div class="price">
  127. <span class="iconfont icon-renminbi_o">288</span>
  128. <span>123人已购买</span>
  129. </div>
  130. </div>
  131. </li>
  132. <li class="item">
  133. <a href=""><img src="images/items/item-12.webp" alt="" /></a>
  134. <div class="desc">
  135. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  136. <div class="price">
  137. <span class="iconfont icon-renminbi_o">288</span>
  138. <span>123人已购买</span>
  139. </div>
  140. </div>
  141. </li>
  142. <li class="item">
  143. <a href=""><img src="images/items/item-13.webp" alt="" /></a>
  144. <div class="desc">
  145. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  146. <div class="price">
  147. <span class="iconfont icon-renminbi_o">288</span>
  148. <span>123人已购买</span>
  149. </div>
  150. </div>
  151. </li>
  152. <li class="item">
  153. <a href=""><img src="images/items/item-14.webp" alt="" /></a>
  154. <div class="desc">
  155. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  156. <div class="price">
  157. <span class="iconfont icon-renminbi_o">288</span>
  158. <span>123人已购买</span>
  159. </div>
  160. </div>
  161. </li>
  162. <li class="item">
  163. <a href=""><img src="images/items/item-15.webp" alt="" /></a>
  164. <div class="desc">
  165. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  166. <div class="price">
  167. <span class="iconfont icon-renminbi_o">288</span>
  168. <span>123人已购买</span>
  169. </div>
  170. </div>
  171. </li>
  172. <li class="item">
  173. <a href=""><img src="images/items/item-16.webp" alt="" /></a>
  174. <div class="desc">
  175. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  176. <div class="price">
  177. <span class="iconfont icon-renminbi_o">288</span>
  178. <span>123人已购买</span>
  179. </div>
  180. </div>
  181. </li>
  182. <li class="item">
  183. <a href=""><img src="images/items/item-17.webp" alt="" /></a>
  184. <div class="desc">
  185. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  186. <div class="price">
  187. <span class="iconfont icon-renminbi_o">288</span>
  188. <span>123人已购买</span>
  189. </div>
  190. </div>
  191. </li>
  192. <li class="item">
  193. <a href=""><img src="images/items/item-18.webp" alt="" /></a>
  194. <div class="desc">
  195. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  196. <div class="price">
  197. <span class="iconfont icon-renminbi_o">288</span>
  198. <span>123人已购买</span>
  199. </div>
  200. </div>
  201. </li>
  202. <li class="item">
  203. <a href=""><img src="images/items/item-19.webp" alt="" /></a>
  204. <div class="desc">
  205. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  206. <div class="price">
  207. <span class="iconfont icon-renminbi_o">288</span>
  208. <span>123人已购买</span>
  209. </div>
  210. </div>
  211. </li>
  212. <li class="item">
  213. <a href=""><img src="images/items/item-20.webp" alt="" /></a>
  214. <div class="desc">
  215. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  216. <div class="price">
  217. <span class="iconfont icon-renminbi_o">288</span>
  218. <span>123人已购买</span>
  219. </div>
  220. </div>
  221. </li>
  222. <li class="item">
  223. <a href=""><img src="images/items/item-21.webp" alt="" /></a>
  224. <div class="desc">
  225. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  226. <div class="price">
  227. <span class="iconfont icon-renminbi_o">288</span>
  228. <span>123人已购买</span>
  229. </div>
  230. </div>
  231. </li>
  232. <li class="item">
  233. <a href=""><img src="images/items/item-22.webp" alt="" /></a>
  234. <div class="desc">
  235. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  236. <div class="price">
  237. <span class="iconfont icon-renminbi_o">288</span>
  238. <span>123人已购买</span>
  239. </div>
  240. </div>
  241. </li>
  242. </ul>
  243. </main>
  244. <!-- 页脚 -->
  245. <footer>
  246. <a href="" class="iconfont icon-taobao"></a>
  247. <a href="" class="iconfont icon-gouwuche"></a>
  248. <a href="" class="iconfont icon-wode"></a>
  249. </footer>
  250. </body>
  251. </html>

css相关文件

index.css

  1. @import 'reset.css';
  2. @import 'public.css';
  3. @import 'style.css';
  4. @import '../font_icon/iconfont.css';

reset.css

  1. *{margin: 0;padding: 0;box-sizing: border-box; }
  2. a{text-decoration: none;color: #555;}
  3. li{list-style: none;}
  4. html{ font-size: calc(100vw/3.75);}
  5. body{font-size:0.13rem ; color: #333;margin: auto;background-color: #f4f4f4;padding: 0 0.15rem;overflow-y: auto;}
  6. body img{width: 100%;height: 100%;}
  7. @media (max-width:320px) {
  8. html{
  9. font-size: 85px;
  10. }
  11. }
  12. @media (min-width:640px) {
  13. html{
  14. font-size: 170px;
  15. }
  16. }

public.css

  1. header,footer{height: 50px;background-color: #fff;position: fixed;z-index: 9999; }
  2. header{top: 0;left: 0;right: 0;}
  3. footer{bottom: 0;left: 0;right: 0;}
  4. main{min-height: 2000px;overflow: hidden;position: relative;top: 50px;left: 0;right: 0; padding-bottom: 0.5rem;}
  5. header{ display: grid;grid-template-columns: 0.58rem 1fr 0.33rem; /*分成散列*/grid-auto-rows: 0.5rem;place-items: center;gap: 0.1rem;}
  6. header a.logo{padding-left: 0.1rem;}
  7. header > a.search{width: 100%;border: 2px solid #ff5000;height: 0.3rem;border-radius: 0.5rem;display: flex;place-content: space-between;place-items: center;}
  8. header > a.search span:first-child{padding-left: 0.1rem;}
  9. header > a.search span:last-of-type{background: linear-gradient(to left,#ff5000, #ffa000);padding: 0.03rem 0.15rem;color: #fff;margin-right: 0.02rem;border-radius: 0.5rem;}
  10. header > a.qiandao{color: #ff5000;font-size: large;}
  11. footer{border-top: 1px solid #ccc;display: grid;grid-template-columns: repeat(3,1fr);place-content: space-around;place-items: center;font-size: smaller;}
  12. footer >a{display: grid;place-items: center;}
  13. footer >a:first-child{color: #ff5000;font-size: 0.35rem;}footer >a {font-size: 0.2rem;}

style.css

  1. main .navs,main .entry,main .list{background-color: #f2f2f2;border-radius: 0.1rem;margin-top: 0.08rem;}
  2. main .navs{display: grid;grid-template-columns: repeat(5,1fr);place-items: center;}
  3. main .navs .item{display: grid;place-items: center;gap: 0 0.5rem;}
  4. main .entry{display: grid;grid-template-columns: repeat(2,1fr);padding: 0.1rem;}
  5. main .entry .item{display: grid;grid-template-columns: repeat(2,1fr);padding: 0.1rem;}
  6. main .entry .item span{background-color: #ff5000;border-radius: 0.1rem;padding: 0 0.1rem;font-size: smaller;color: #fff;}
  7. main .entry .item:nth-of-type(-n+2){border-bottom:0.01rem solid #dedede;}
  8. main .entry .item .title{ grid-column: span 2; display: flex; place-items: center;}
  9. main .list{display: grid; grid-template-columns:repeat(2,1fr)}
  10. main .list .item{display: grid;padding: 0.05rem;}
  11. main .list .item img{border-radius: 0.1rem 0.1rem 0 0;}
  12. main .list .item .desc{padding: 0.1rem;font-size: smaller;}
  13. main .list .item .price .iconfont{color: #ff5500;font-size: smaller;}
  14. main .list .item .price span:last-of-type{color: #bbb; font-size: smaller;}

iconfont.css

  1. @font-face {
  2. font-family: "iconfont"; /* Project id 3510297 */
  3. src: url('iconfont.woff2?t=1657963012397') format('woff2'),
  4. url('iconfont.woff?t=1657963012397') format('woff'),
  5. url('iconfont.ttf?t=1657963012397') format('truetype');
  6. }
  7. .iconfont {
  8. font-family: "iconfont" !important;
  9. font-size: 16px;
  10. font-style: normal;
  11. -webkit-font-smoothing: antialiased;
  12. -moz-osx-font-smoothing: grayscale;
  13. }
  14. .icon-qiandao-xuanzhong:before {
  15. content: "\e62c";
  16. }
  17. .icon-gouwuche:before {
  18. content: "\e652";
  19. }
  20. .icon-taobao:before {
  21. content: "\e660";
  22. }
  23. .icon-renminbi_o:before {
  24. content: "\eba2";
  25. }
  26. .icon-wode:before {
  27. content: "\e625";
  28. }
Correcting teacher:PHPzPHPz

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