ASCII码 ASCII码

仿淘宝移动端首页

发布于:2022-05-13 10:14:56  栏目:技术文档

淘宝移动端首页

1.官方实图

2 .效果图

3.代码

  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="2.css">
  8. <link rel="stylesheet" href="//at.alicdn.com/t/font_3375711_ufjbbl3qkv.css">
  9. <title>Document</title>
  10. </head>
  11. <body >
  12. <header>
  13. <!-- 顶部 -->
  14. <div class="top">
  15. <div class="logo iconfont icon-taobao"></div>
  16. <div class="search">
  17. <div class="bb">
  18. <span class="xun">寻找宝贝店铺 </span>
  19. <div class="ss"><span >搜索</span></div>
  20. </div>
  21. </div>
  22. <div class="qdao"><img src="../5.8/img/O1CN01ftum4629SHP6bCqTm_!!6000000008066-2-tps-99-99.png" alt=""></div>
  23. </div>
  24. <ul class="nav">
  25. <li class="item"><a href=""><img src="../5.8/img/1.png" alt=""></a>天猫新品</li>
  26. <li class="item"> <a href=""><img src="../5.8/img/2.png" alt=""></a>天猫新品</li>
  27. <li class="item"> <a href=""><img src="../5.8/img/3.png" alt=""></a>天猫新品</li>
  28. <li class="item"> <a href=""><img src="../5.8/img/4.png" alt=""></a>天猫新品</li>
  29. <li class="item"> <a href=""><img src="../5.8/img/5.png" alt=""></a>天猫新品</li>
  30. <li class="item"> <a href=""><img src="../5.8/img/6.png" alt=""></a>天猫新品</li>
  31. <li class="item"> <a href=""><img src="../5.8/img/7.png" alt=""></a>天猫新品</li>
  32. <li class="item"> <a href=""><img src="../5.8/img/8.png" alt=""></a>天猫新品</li>
  33. <li class="item"> <a href=""><img src="../5.8/img/9.png" alt=""></a>天猫新品</li>
  34. <li class="item"> <a href=""><img src="../5.8/img/10.png" alt=""></a>天猫新品</li>
  35. </ul>
  36. </header>
  37. <main style="height: 1600px">
  38. <div class="navs" onclick="">
  39. <div class="box">
  40. <div class="title" >
  41. <h3 class="jhs">聚划算</h3>
  42. <span class="tag">品牌折扣</span>
  43. </div>
  44. <div class="dsec">
  45. <div class="left"><img src="./img/11.webp" alt=""></div>
  46. <div class="right"> <img src="./img/12.webp" alt=""></div>
  47. </div>
  48. </div>
  49. <div class="box">
  50. <div class="title">
  51. <h3 class="jhs">天天特卖</h3>
  52. <span class="tag">1元秒杀</span>
  53. </div>
  54. <div class="dsec">
  55. <div class="left"><img src="./img/13.webp" alt=""></div>
  56. <div class="right"><img src="./img/14.webp" alt=""></div>
  57. </div>
  58. </div>
  59. <div class="box">
  60. <div class="title">
  61. <h3 class="jhs">有好货</h3>
  62. <span class="tag" style="background-color: rgb(63,142,227)">好口碑</span>
  63. </div>
  64. <div class="dsec">
  65. <div class="left"><img src="./img/15.webp" alt=""></div>
  66. <div class="right"><img src="./img/16.webp" alt=""></div>
  67. </div>
  68. </div>
  69. <div class="box">
  70. <div class="title">
  71. <h3 class="jhs">每日好店</h3>
  72. <span class="tag" style="background-color: rgb(241,156,60)">特色</span>
  73. </div>
  74. <div class="dsec">
  75. <div class="left"><img src="./img/17.webp" alt=""></div>
  76. <div class="right"><img src="./img/18.webp" alt=""></div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="bot">
  81. <div class="tp"><img src="./img/19.webp" alt=""></div>
  82. <div class="box">
  83. <img src="./img/20.webp" alt="">
  84. <div class="tt"><span >鸣笛加厚不锈钢电水壶家用烧水壶大容量电热水壶茶壶燃气电磁炉用</span></div>
  85. <div class="jg"><span class="qian" style="color:rgb(238,113,64)">¥&nbsp;20</span><span class="rs">900+人已购买</span></div>
  86. </div>
  87. <div class="box">
  88. <img src="./img/21.webp" alt="">
  89. <div class="tt"><span >厨房洗菜篮子不锈钢沥水篮洗菜盆网篮圆形水果篮果盘淘米篮洗米筛</span></div>
  90. <div class="jg"><span class="qian" style="color:rgb(238,113,64)">¥&nbsp;11.2</span><span class="rs">48人已购买</span></div>
  91. </div>
  92. <div class="box">
  93. <img src="./img/22.webp" alt="">
  94. <div class="tt"><span >100支埃及棉纯棉贡缎四件套1.8m 米长绒棉全棉春秋田园风美式简约</span></div>
  95. <div class="jg"><span class="qian" style="color:rgb(238,113,64)">¥&nbsp;286</span><span class="rs">17人已购买</span></div>
  96. </div>
  97. <div class="box">
  98. <img src="./img/23.webp" alt="">
  99. <div class="tt"><span >日本进口盘御浓烧青海波盘子碟子日式和风餐具碗釉下彩陶瓷面碗</span></div>
  100. <div class="jg"><span class="qian" style="color:rgb(238,113,64)">¥&nbsp;24.5</span><span class="rs">100+人已购买</span></div>
  101. </div>
  102. <div class="box">
  103. <img src="./img/24.webp" alt="">
  104. <div class="tt"><span >日本进口盘御浓烧青海波盘子碟子日式和风餐具碗釉下彩陶瓷面碗</span></div>
  105. <div class="jg"><span class="qian" style="color:rgb(238,113,64)">¥&nbsp;16.5</span><span class="rs">100+人已购买</span></div>
  106. </div>
  107. </div>
  108. </main>
  109. <div class="bt">
  110. <button class="anniu">打开淘宝</button>
  111. </div>
  112. <footer>
  113. <div class="item a">
  114. <a href="" class="iconfont icon-shejiaotubiao-44"></a>
  115. </div>
  116. <div class="item">
  117. <a href="" class="iconfont icon-gouwuche"></a>
  118. <a href="">购物车</a>
  119. </div>
  120. <div class="item">
  121. <a href="" class="iconfont icon-wodetaobao "></a>
  122. <a href="">我的淘宝</a>
  123. </div>
  124. </footer>
  125. </body>
  126. </html>

css

  1. *{
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. a{
  7. text-decoration: none;
  8. }
  9. li{
  10. list-style: none;
  11. }
  12. :root{
  13. font-size: calc(100vw / 3.75);
  14. }
  15. body{
  16. font-size: 0.12rem;
  17. max-width: 720px;
  18. min-width: 320px;
  19. margin: auto;
  20. background-color: #f4f4f4;
  21. }
  22. @media screen and (max-width: 320px) {
  23. :root {
  24. font-size: 85px;
  25. }
  26. }
  27. @media screen and (min-width: 640px) {
  28. :root {
  29. font-size: 170px;
  30. }
  31. }
  32. header {
  33. position: relative;
  34. }
  35. header .top{
  36. width: 100vw;
  37. height: 51px;
  38. position: fixed;
  39. left: 0;
  40. right: 0;
  41. top: 0;
  42. background-color: #f4f4f4;
  43. display: grid;
  44. grid-template-columns: 50px 1fr 35px;
  45. gap: 0 10px;
  46. padding: 0.05rem;
  47. }
  48. header .top .search .bb{
  49. display: grid;
  50. grid-template-columns: repeat(2,1fr);
  51. grid-template-rows: 35px;
  52. }
  53. header .top .search .bb .xun{
  54. place-self: center start;
  55. font-size: 0.14rem;
  56. color: rgb(102,102,102);
  57. padding-left: 20px;
  58. padding-bottom: 4px;
  59. }
  60. header .top .search .bb .ss{
  61. place-self: center end;
  62. display: grid;
  63. grid-template-columns: 0.6rem;
  64. grid-template-rows: 27px;
  65. margin-bottom: 7px;
  66. margin-top: 3px;
  67. padding: 1px 0;
  68. font-size: 0.14rem;
  69. color: #fff;
  70. border-radius: 0.16rem;
  71. border: 0.01rem solid #fff;
  72. background: linear-gradient(to right, #FF8D0E, #FF5000);
  73. }
  74. header .top .search .bb .ss span{
  75. place-self: center;
  76. }
  77. header .top .search{
  78. height: 35px;
  79. border: 0.015rem solid #ff5000;
  80. border-radius: 0.5rem;
  81. }
  82. header .top .qdao img{
  83. width: 100%;
  84. padding-top: .01rem;
  85. }
  86. header .top .logo{
  87. font-size: 20px;
  88. color: rgb(245, 97, 28);
  89. place-self: center;
  90. margin-left: 0.05rem;
  91. }
  92. header .nav{
  93. position:absolute;
  94. top: 51px;
  95. display: grid;
  96. grid-template-columns: repeat(5,1fr);
  97. grid-template-rows: repeat(2,1fr);
  98. padding: 0 0.05rem 0.15rem 0.05rem;
  99. background:#fff;
  100. margin: 0 0.1rem;
  101. border-radius: 0.1rem;
  102. }
  103. header .nav .item{
  104. display: grid;
  105. place-items: center;
  106. }
  107. header .nav img{
  108. width: 100%;
  109. }
  110. main .navs {
  111. display: grid;
  112. grid-template-rows: repeat(2,1fr);
  113. grid-template-columns: repeat(2,1fr);
  114. background-color: #fff;
  115. border-radius: 0.2rem ;
  116. }
  117. main .navs .box:first-of-type{
  118. border-right: 0.1px solid rgb(221, 218, 218);
  119. border-bottom: 0.1px solid rgb(221, 218, 218);
  120. }
  121. main .navs .box:last-of-type{
  122. border-left: 0.4px solid rgb(221, 218, 218);
  123. border-top: 0.1px solid rgb(221, 218, 218);
  124. }
  125. main .navs .box .dsec .right img{
  126. width: 83.2px;
  127. height: 83.2px;
  128. }
  129. main .navs .box .dsec .left img{
  130. width: 65.52px;
  131. height:65.52px;
  132. }
  133. main .navs .box .title{
  134. display: flex;
  135. }
  136. main .navs .box .title .jhs{
  137. font-size: 0.15rem;
  138. color: #111111;
  139. padding-left: 0.06rem;
  140. margin-left: 0.03rem;
  141. }
  142. main .navs .box .dsec{
  143. display: grid;
  144. grid-template-columns: repeat(2,1fr);
  145. place-items: center;
  146. }
  147. main .navs .box .title .tag{
  148. color: rgb(255, 255, 255);
  149. font-size: 11px;
  150. background-color: rgb(255, 66, 0);
  151. border-radius: 0.02rem;
  152. padding: 0 0.03rem;
  153. margin-left: 0.1rem;
  154. line-height: 0.14rem;
  155. height: 0.14rem;
  156. }
  157. main{
  158. position: relative;
  159. top: calc(0.51rem + 1.66rem);
  160. padding: 0.1rem;
  161. margin-top: 1px;
  162. }
  163. main img{
  164. width: 100%;
  165. height: 100%;
  166. }
  167. main .bot{
  168. display: grid;
  169. grid-template-columns: repeat(2,1fr);
  170. grid-template-rows: repeat(3,1fr);
  171. gap: 10px;
  172. position: relative;
  173. top: 0.1rem;
  174. }
  175. main .bot img{
  176. border-radius: 0.1rem;
  177. }
  178. main .bot .box{
  179. display: grid;
  180. border-radius: 0.1rem;
  181. background-color: #fff;
  182. }
  183. main .bot .box .tt{
  184. padding: 10px 5px 10px 15px;
  185. }
  186. main .bot .box .jg{
  187. padding-bottom: 10px;
  188. }
  189. main .bot .box .jg .rs{
  190. color: #999999;
  191. padding-left: 5px;
  192. }
  193. main .bot .box .jg .qian{
  194. font-size: 14.56px;
  195. line-height: 16.64px;
  196. padding-left: 10px;
  197. }
  198. footer {
  199. width: 100vw;
  200. position: fixed;
  201. left: 0;
  202. right: 0;
  203. bottom: 0;
  204. background-color: #f4f4f4;
  205. display: grid;
  206. grid-template-columns: repeat(3,1fr);
  207. place-items: center;
  208. }
  209. footer .item{
  210. display: grid;
  211. place-items: center;
  212. }
  213. footer .item .iconfont{
  214. font-size: 0.3rem;
  215. }
  216. footer .item a{
  217. color: #5D656B;
  218. }
  219. footer .item.a .iconfont{
  220. color: coral;
  221. font-size: 0.5rem;
  222. }
  223. .bt{
  224. display: grid;
  225. place-items: center;
  226. }
  227. .bt .anniu{
  228. width: 1.35938rem;
  229. height: 0.421875rem;
  230. box-shadow: rgb(18 18 18 / 25%) 0px 2px 5px;
  231. background-color: rgb(255, 80, 0);
  232. font-size: 0.164063rem;
  233. color: rgb(255, 255, 255);
  234. border-radius: 0.210938rem;
  235. text-align: center;
  236. line-height: 0.421875rem;
  237. font-weight: bold;
  238. align-items: center;
  239. z-index: 1000000;
  240. position: fixed;
  241. left: 50%;
  242. bottom: 0.703125rem;
  243. font-family: Helvetica, sans-serif;
  244. transform: translate(-50%);
  245. text-decoration: none;
  246. user-select: none;
  247. border: none;
  248. }
相关推荐
阅读 +