博客列表 >仿淘宝移动端首页

仿淘宝移动端首页

晨
原创
2022年03月30日 15:16:19458浏览

仿淘宝移动端首页html代码

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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>仿淘宝移动端首页-2</title>
  8. <link rel="stylesheet" href="font_icon/iconfont.css" />
  9. <link rel="stylesheet" href="css/reset.css" />
  10. <link rel="stylesheet" href="css/header.css" />
  11. <link rel="stylesheet" href="css/footer.css" />
  12. <link rel="stylesheet" href="css/main.css" />
  13. </head>
  14. <body>
  15. <!-- 头部 -->
  16. <header>
  17. <!-- 顶部 -->
  18. <div class="top">
  19. <!-- logo -->
  20. <div class="logo iconfont icon-shejiaotubiao-08"></div>
  21. <!-- 搜索框 -->
  22. <div class="search">
  23. <div class="keys">
  24. <span class="iconfont icon-fangdajing"></span>
  25. <span>寻找宝贝店铺</span>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- 轮播图 -->
  30. <div class="slider">
  31. <a href=""><img src="images/banner/banner1.jpg" alt="" /></a>
  32. </div>
  33. <!-- 导航组 -->
  34. <ul class="nav">
  35. <li class="item">
  36. <a href=""><img src="images/nav/nav6.png" alt="" /></a>
  37. <a href="">天猫新品</a>
  38. </li>
  39. <li class="item">
  40. <a href=""><img src="images/nav/nav3.png" alt="" /></a>
  41. <a href="">今日爆款</a>
  42. </li>
  43. <li class="item">
  44. <a href=""><img src="images/nav/nav1.png" alt="" /></a>
  45. <a href="">天猫超市</a>
  46. </li>
  47. <li class="item">
  48. <a href=""><img src="images/nav/nav2.png" alt="" /></a>
  49. <a href="">充值中心</a>
  50. </li>
  51. <li class="item">
  52. <a href=""><img src="images/nav/nav5.png" alt="" /></a>
  53. <a href="">机票酒店</a>
  54. </li>
  55. <li class="item">
  56. <a href=""><img src="images/nav/nav8.png" alt="" /></a>
  57. <a href="">金币庄园</a>
  58. </li>
  59. <li class="item">
  60. <a href=""><img src="images/nav/nav7.png" alt="" /></a>
  61. <a href="">阿里拍卖</a>
  62. </li>
  63. <li class="item">
  64. <a href=""><img src="images/nav/nav4.png" alt="" /></a>
  65. <a href="">分类</a>
  66. </li>
  67. <li class="item">
  68. <a href=""><img src="images/nav/nav7.png" alt="" /></a>
  69. <a href="">阿里拍卖</a>
  70. </li>
  71. <li class="item">
  72. <a href=""><img src="images/nav/nav4.png" alt="" /></a>
  73. <a href="">分类</a>
  74. </li>
  75. </ul>
  76. </header>
  77. <!-- 主体 -->
  78. <main style="height: 1600px">
  79. <!-- 1. 聚划算 -->
  80. <div class="top">
  81. <div class="item jhs">
  82. <div class="box">
  83. <h3 class="title">聚划算</h3>
  84. <div class="desc">
  85. <h4>品牌折扣</h4>
  86. <img src="images/items/item1.png" alt="" />
  87. </div>
  88. </div>
  89. <div class="box">
  90. <!-- 用实体空格表示占位符 -->
  91. <h3 class="title">&nbsp;</h3>
  92. <div class="desc">
  93. <h4>划算好货</h4>
  94. <img src="images/items/item2.png" alt="" />
  95. </div>
  96. </div>
  97. <div class="box">
  98. <h3 class="title">淘抢购</h3>
  99. <div class="desc">
  100. <h4>限时半价</h4>
  101. <img src="images/items/item3.png" alt="" />
  102. </div>
  103. </div>
  104. <div class="box">
  105. <h3 class="title">天天特价</h3>
  106. <div class="desc">
  107. <h4>9.9包邮</h4>
  108. <img src="images/items/item4.png" alt="" />
  109. </div>
  110. </div>
  111. </div>
  112. <div class="item right">
  113. <div class="box">
  114. <h3 class="title">淘宝直播 <span class="tag" style="background-color: red">LIVE</span></h3>
  115. <div class="detail">
  116. <div class="left">
  117. <span class="title">好物传送门</span>
  118. <img src="images/items/item5.png" alt="" />
  119. </div>
  120. <div class="right">
  121. <img src="images/items/item6.png" alt="" />
  122. </div>
  123. </div>
  124. </div>
  125. <div class="box">
  126. <h3 class="title">有好货&nbsp;<span class="tag" style="background-color: skyblue">品质好物</span></h3>
  127. <div class="detail">
  128. <div class="left">
  129. <span class="title" style="color: skyblue">全民口碑推荐</span>
  130. <img src="images/items/item7.png" alt="" />
  131. </div>
  132. <div class="right">
  133. <img src="images/items/item21.png" alt="" />
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="item right">
  139. <div class="box">
  140. <h3 class="title">每日好店 <span class="tag" style="background-color: orange">精选</span></h3>
  141. <div class="detail">
  142. <div class="left">
  143. <span class="title">深挖藏的店</span>
  144. <img src="images/items/item9.png" alt="" />
  145. </div>
  146. <div class="right">
  147. <img src="images/items/item10.png" alt="" />
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. <div class="item right">
  153. <div class="box">
  154. <h3 class="title">哇哦视频<span class="tag" style="background-color: orange">亲测</span></h3>
  155. <div class="detail">
  156. <div class="left">
  157. <span class="title">粉丝都爱看</span>
  158. <img src="images/items/item11.png" alt="" />
  159. </div>
  160. <div class="right">
  161. <img src="images/items/item12.png" alt="" />
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <!-- 底部滚动显示文本 -->
  167. <div class="item footer">
  168. <div class="title">淘宝头条</div>
  169. <div class="content">
  170. <span class="type">评测</span>
  171. <span style="font-size: larger">五款最强的防******</span>
  172. </div>
  173. </div>
  174. </div>
  175. <!-- 2. 商品列表 -->
  176. <div class="list">
  177. <div class="title">
  178. 猜你喜欢
  179. </div>
  180. <div class="commodity">
  181. <div class="img">
  182. <img src="images/items/item01.webp" alt="">
  183. </div>
  184. <div class="detail">
  185. <div class="desc">
  186. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  187. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  188. </div>
  189. </div>
  190. <div class="commodity">
  191. <div class="img">
  192. <img src="images/items/item02.webp" alt="">
  193. </div>
  194. <div class="detail">
  195. <div class="desc">
  196. 商品特点描述商品特点描述,商品特点描述商品特点描述。</div>
  197. <div class="price"><span class="iconfont icon-rmb">45</span><span class="num">89人已购买</span></div>
  198. </div>
  199. </div>
  200. <div class="commodity">
  201. <div class="img">
  202. <img src="images/items/item03.webp" alt="">
  203. </div>
  204. <div class="detail">
  205. <div class="desc">
  206. 商品特点描述商品特点描述,商品特点描述商品特点描述。</div>
  207. <div class="price"><span class="iconfont icon-rmb">123</span><span class="num">56人已购买</span></div>
  208. </div>
  209. </div>
  210. <div class="commodity">
  211. <div class="img">
  212. <img src="images/items/item04.webp" alt="">
  213. </div>
  214. <div class="detail">
  215. <div class="desc">
  216. 商品特点描述商品特点描述,商品特点描述商品特点描述。好商品。</div>
  217. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  218. </div>
  219. </div>
  220. <div class="commodity">
  221. <div class="img">
  222. <img src="images/items/item05.webp" alt="">
  223. </div>
  224. <div class="detail">
  225. <div class="desc">
  226. 商品特点描述商品特点描述,商品特点描述商品特点描述。好商品。</div>
  227. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  228. </div>
  229. </div>
  230. <div class="commodity">
  231. <div class="img">
  232. <img src="images/items/item06.webp" alt="">
  233. </div>
  234. <div class="detail">
  235. <div class="desc">
  236. 商品特点描述商品特点描述,商品特点描述商品特点描述。好商品。</div>
  237. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  238. </div>
  239. </div>
  240. <div class="commodity">
  241. <div class="img">
  242. <img src="images/items/item07.webp" alt="">
  243. </div>
  244. <div class="detail">
  245. <div class="desc">
  246. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  247. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  248. </div>
  249. </div>
  250. <div class="commodity">
  251. <div class="img">
  252. <img src="images/items/item08.webp" alt="">
  253. </div>
  254. <div class="detail">
  255. <div class="desc">
  256. 商品特点描述商品特点描述,商品特点描述商品特点描述。好商品。</div>
  257. <div class="price"><span class="iconfont icon-rmb">36</span><span class="num">456人已购买</span></div>
  258. </div>
  259. </div>
  260. <div class="commodity">
  261. <div class="img">
  262. <img src="images/items/item09.webp" alt="">
  263. </div>
  264. <div class="detail">
  265. <div class="desc">
  266. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  267. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  268. </div>
  269. </div>
  270. <div class="commodity">
  271. <div class="img">
  272. <img src="images/items/item10.webp" alt="">
  273. </div>
  274. <div class="detail">
  275. <div class="desc">
  276. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  277. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  278. </div>
  279. </div>
  280. <div class="commodity">
  281. <div class="img">
  282. <img src="images/items/item11.webp" alt="">
  283. </div>
  284. <div class="detail">
  285. <div class="desc">
  286. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  287. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  288. </div>
  289. </div>
  290. <div class="commodity">
  291. <div class="img">
  292. <img src="images/items/item12.webp" alt="">
  293. </div>
  294. <div class="detail">
  295. <div class="desc">
  296. 哈尔滨志勇烧饼10个包邮东北老式油盐烧饼零食特产传统糕点早餐.</div>
  297. <div class="price"><span class="iconfont icon-rmb">89</span><span class="num">89人已购买</span></div>
  298. </div>
  299. </div>
  300. </div>
  301. </main>
  302. <!-- 底部 -->
  303. <footer>
  304. <div class="item active">
  305. <a href="" class="iconfont icon-shejiaotubiao-44"></a>
  306. </div>
  307. <div class="item">
  308. <a href="" class="iconfont icon-gouwuche"></a>
  309. <a href="">购物车</a>
  310. </div>
  311. <div class="item">
  312. <a href="" class="iconfont icon-wodetaobao"></a>
  313. <a href="">我的淘宝</a>
  314. </div>
  315. </footer>
  316. </body>
  317. </html>

main.css代码

  1. main {
  2. position: relative;
  3. top: calc(0.37rem + 1.25rem + 1.5rem);
  4. padding: 0.1rem;
  5. }
  6. main img {
  7. width: 100%;
  8. height: 100%;
  9. }
  10. main .top {
  11. background-color: #fff;
  12. border-radius: 0.1rem;
  13. min-height: 3rem;
  14. /* 3行2列 */
  15. display: grid;
  16. grid-template-columns: repeat(2, 1fr);
  17. gap: 0.1rem;
  18. padding: 0.1rem;
  19. }
  20. /* 最后一行,跨2列 */
  21. main .top .item:last-of-type {
  22. grid-column: span 2;
  23. /* background-color: yellow; */
  24. }
  25. /* 左上角的聚划算 */
  26. main .top .item.jhs {
  27. display: grid;
  28. grid-template-columns: repeat(2, 1fr);
  29. gap: 0.1rem;
  30. }
  31. main .top .item.jhs .box {
  32. display: grid;
  33. gap: 0.1rem;
  34. }
  35. main .top .item.jhs .box .desc {
  36. display: grid;
  37. background-color: rgb(243, 235, 236);
  38. border-radius: 0.1rem;
  39. padding: 0.1rem;
  40. }
  41. /* 右侧, 上下二组 */
  42. main .top .item.right {
  43. display: grid;
  44. gap: 0.1rem;
  45. }
  46. main .top .item.right .box {
  47. display: grid;
  48. }
  49. main .top .item.right .box .title {
  50. grid-column: span 2;
  51. }
  52. main .top .item.right .box .title .tag {
  53. color: #fff;
  54. font-weight: normal;
  55. padding: 1px;
  56. border-radius: 0.05rem;
  57. font-size: smaller;
  58. }
  59. main .top .item.right .box .detail {
  60. display: grid;
  61. grid-template-columns: repeat(2, 1fr);
  62. }
  63. main .top .item.right .box .detail .left {
  64. display: grid;
  65. }
  66. /* 底部公告 */
  67. main .item.footer {
  68. display: grid;
  69. grid-template-columns: 0.6rem 1fr;
  70. padding: 0.1rem 0;
  71. }
  72. main .item.footer .type {
  73. background-color: rgb(238, 202, 206);
  74. color: darkorange;
  75. padding: 2px 5px;
  76. border-radius: 3px;
  77. }
  78. main .item.footer .title {
  79. font-size: larger;
  80. font-weight: bolder;
  81. }
  82. main .list{
  83. display: grid;
  84. grid-template-columns: repeat(2,1fr);
  85. gap: 0.1rem;
  86. padding:0.1rem;
  87. }
  88. main .list .title{
  89. grid-column: span 2;
  90. font-size: 0.18rem;
  91. color: #fd3f31;
  92. text-align: left;
  93. padding-left: 0.1rem;
  94. }
  95. main .list .commodity{
  96. background-color: #fff;
  97. border-radius: 0.1rem;
  98. display: grid;
  99. }
  100. main .list .commodity img{
  101. border-radius: 0.1rem 0.1rem 0 0;
  102. width: 100%;
  103. height: 100%;
  104. }
  105. main .list .commodity .detail{
  106. padding: 0.1rem;
  107. display: grid;
  108. gap:0.1rem;
  109. }
  110. main .list .commodity .price .iconfont{
  111. color: coral;
  112. font-size: large;
  113. margin-right: 0.1rem;
  114. }
  115. main .list .commodity .price .num {
  116. color: #9b9b9b;
  117. font-weight: 500;
  118. }

运行效果

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