Blogger Information
Blog 46
fans 2
comment 0
visits 19463
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿淘宝首页面
P粉314265155
Original
308 people have browsed it

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>仿淘宝移动端</title>
  8. <link rel="stylesheet" href="../0718/static/css/zuoyerest.css">
  9. <link rel="stylesheet" href="../0718/static/css/zuoyepublic.css">
  10. <link rel="stylesheet" href="../0718/0718/font_icon/iconfont.css">
  11. </head>
  12. <body>
  13. <header>
  14. <a href=""><img src="./0718/images/taobao.png" alt=""></a>
  15. <a href="">
  16. <span class="xunzhao">寻找宝贝店铺</span>
  17. <span class="sousuo ">搜索</span>
  18. </a>
  19. <a href="" class="iconfont icon-qiandao-xuanzhong"></a>
  20. </header>
  21. <main>
  22. <!-- 顶部导航 -->
  23. <ul class="navs1">
  24. <li class="item">
  25. <a href=""><img src="../0718/0718/images/navs/tmxb.webp" alt=""></a>
  26. <span>天猫新品</span>
  27. </li>
  28. <li class="item" >
  29. <a href=""><img src="../0718/0718/images/navs/jrbk.webp" alt=""></a>
  30. <span>今日爆款</span>
  31. </li>
  32. <li class="item">
  33. <a href=""><img src="../0718/0718/images/navs/tmgj.webp" alt=""></a>
  34. <span>天猫国际</span>
  35. </li>
  36. <li class="item">
  37. <a href=""><img src="../0718/0718/images/navs/fzlx.webp" alt=""></a>
  38. <span>飞猪旅行</span>
  39. </li>
  40. <li class="item">
  41. <a href=""><img src="../0718/0718/images/navs/tmcx.webp" alt=""></a>
  42. <span>天猫超市</span>
  43. </li>
  44. <li class="item">
  45. <a href=""><img src="../0718/0718/images/navs/tmcx.webp" alt=""></a>
  46. <span>淘宝吃货</span>
  47. </li>
  48. <li class="item">
  49. <a href=""><img src="../0718/0718/images/navs/sqk.webp" alt=""></a>
  50. <span>省钱卡</span>
  51. </li>
  52. <li class="item">
  53. <a href=""><img src="../0718/0718/images/navs/ltjb.webp" alt=""></a>
  54. <span>领淘金币</span>
  55. </li>
  56. <li class="item">
  57. <a href=""><img src="../0718/0718/images/navs/alpm.webp" alt=""></a>
  58. <span>阿里拍卖</span>
  59. </li>
  60. <li class="item">
  61. <a href=""><img src="../0718/0718/images/navs/fl.webp" alt=""></a>
  62. <span>分类</span>
  63. </li>
  64. </ul>
  65. <!-- 快速入口 -->
  66. <ul class="entry">
  67. <li class="item">
  68. <div class="title">
  69. <h3>聚划算</h3>
  70. <span style="background-color: coral">品牌折扣</span>
  71. </div>
  72. <a href=""><img src="../0718/0718/images/items/item-1.webp" alt=""></a>
  73. <a href=""><img src="../0718/0718/images/items/item-2.webp" alt=""></a>
  74. </li>
  75. <li class="item">
  76. <div class="title">
  77. <h3>天天特卖</h3>
  78. <span style="background-color: coral">1元秒杀</span>
  79. </div>
  80. <a href=""><img src="../0718/0718/images/items/item-1.webp" alt=""></a>
  81. <a href=""><img src="../0718/0718/images/items/item-2.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="../0718/0718/images/items/item-1.webp" alt=""></a>
  89. <a href=""><img src="../0718/0718/images/items/item-2.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="../0718/0718/images/items/item-1.webp" alt=""></a>
  97. <a href=""><img src="../0718/0718/images/items/item-2.webp" alt=""></a>
  98. </ul>
  99. <!-- 商品列表 -->
  100. <ul class="list">
  101. <li class="item">
  102. <a href="" ><img src="../0718/0718/images/items/item-16.webp" alt=""></a>
  103. <div class="desc">
  104. <a href=""> 商品描述商品描述商品描述商品描述商品描述</a>
  105. <div class="price">
  106. <span class="iconfont icon-renminbi_o">288</span>
  107. <span>123人已购买</span>
  108. </div>
  109. </div>
  110. <!-- <div class="desc">
  111. <a href="">
  112. <span> 商品描述商品描述商品描述商品描述商品描述商品描述 </span>
  113. <div>
  114. <span>¥320</span>
  115. <span>51人购买</span>
  116. </div>
  117. </a>
  118. </div> -->
  119. </li>
  120. <li class="item">
  121. <a href="" ><img src="../0718/0718/images/items/item-16.webp" alt=""></a>
  122. <div class="desc">
  123. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  124. <div class="price">
  125. <span class="iconfont icon-renminbi_o">288</span>
  126. <span>123人已购买</span>
  127. </div>
  128. </div>
  129. </li>
  130. <li class="item">
  131. <a href=""><img src="../0718/0718/images/items/item-16.webp" alt=""></a>
  132. <div class="desc">
  133. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  134. <div class="price">
  135. <span class="iconfont icon-renminbi_o">288</span>
  136. <span>123人已购买</span>
  137. </div>
  138. </div>
  139. </li>
  140. <li class="item">
  141. <a href=""><img src="../0718/0718/images/items/item-16.webp" alt=""></a>
  142. <div class="desc">
  143. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  144. <div class="price">
  145. <span class="iconfont icon-renminbi_o">288</span>
  146. <span>123人已购买</span>
  147. </div>
  148. </div>
  149. </a>
  150. </div>
  151. </li>
  152. </ul>
  153. </main>
  154. <footer>
  155. <a href="" class="iconfont icon-taobao"></a>
  156. <a href="">
  157. <span class="iconfont icon-gouwuche"> </span>
  158. <span>购物车</span>
  159. </a>
  160. <a href="">
  161. <span class=" iconfont icon-wode" style="font-size: 0.25rem;"></span>
  162. <span>我的淘宝</span>
  163. </a>
  164. </footer>
  165. </body>
  166. </html>

rest.css

  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. a {
  7. text-decoration: none;
  8. color: coral ;
  9. }
  10. li {
  11. list-style: none;
  12. }
  13. html {
  14. font-size: calc(100vw / 3.75);
  15. }
  16. body img {
  17. width: 100%;
  18. }
  19. body {
  20. font-size: 0.14rem;
  21. color: #333;
  22. background-color: #f4f4f4;
  23. margin: auto;
  24. /* overflow: hidden; */
  25. padding: 0 0.15rem;
  26. height: 2000px;
  27. }
  28. @media (max-width:320px) {
  29. html {
  30. font-size:85px;
  31. }
  32. }
  33. @media (min-width: 640px) {
  34. html {
  35. font-size: 170px;
  36. }
  37. }

public.css

  1. <style>
  2. header ,footer {
  3. height: 50px;
  4. background-color: #f4f4f4;
  5. position: fixed;
  6. }
  7. footer {
  8. height: 50px;
  9. background-color: #f4f4f4;
  10. position: fixed;
  11. }
  12. header {
  13. display: grid;
  14. grid-template-columns: 0.5rem 1fr 0.33rem;
  15. top: 0;
  16. left: 0;
  17. right: 0;
  18. z-index: 100;
  19. gap:0.1rem ;
  20. place-items: center ;
  21. /* place-content: center; */
  22. grid-auto-rows: 0.5rem;
  23. }
  24. header a:first-of-type {
  25. width: 0.5rem;
  26. padding-left: 00.1rem;
  27. padding-top: 0.06rem;
  28. }
  29. header a:nth-of-type(2) {
  30. border: 2px solid #ff5000;
  31. border-radius: 30px;
  32. /* width: auto; */
  33. color: #555;
  34. display: flex;
  35. /* place-content: space-around; */
  36. place-content: space-between;
  37. place-items: center;
  38. /* 分散对齐,必须将宽度按照百分比撑开,不然没有效果,因为你前面已经使用1fr ,剩余宽度已经自动给定了
  39. 在内容对齐分散一定要在容器内容进行
  40. */
  41. width: 100%;
  42. height: 30px;
  43. }
  44. header .xunzhao {
  45. /* background-color: aquamarine; */
  46. padding-left: 10px;
  47. }
  48. header .sousuo {
  49. /* background-color: aquamarine; */
  50. padding-right: 10px;
  51. background-color: #ff5f00;
  52. border-radius: 0.15rem;
  53. padding: 0.02rem 0.15rem;
  54. margin-right: 00.02rem;
  55. background: linear-gradient(to left , #ff5000 ,#ffa000);
  56. }
  57. header a:last-of-type {
  58. /* background: #ff5000; */
  59. /* 引入阿里字体 不能使用背景色 */
  60. color: rgb(255, 0, 0);
  61. /* width: 0.01rem; */
  62. width: 100%;
  63. /* font-size: 0.20rem; */
  64. }
  65. footer {
  66. bottom: 0;
  67. left: 0;
  68. right: 0;
  69. height: 60px;
  70. background: f4f4f4 ;
  71. display: grid;
  72. grid-template-columns: repeat(3 ,1fr);
  73. place-items: center;
  74. place-content: center;
  75. }
  76. footer a:first-of-type {
  77. /* background-color: #ff5000; */
  78. color: #ff5000;
  79. font-size: 0.35rem;
  80. }
  81. footer a:last-of-type {
  82. /* background-color: #ff5000; */
  83. color: #555;
  84. /* font-size: 0.35rem; */
  85. display: grid;
  86. place-content: center;
  87. place-items: center;
  88. font-size: 0.16rem;
  89. }
  90. footer a:nth-of-type(2) {
  91. /* background-color: #ff5000; */
  92. color: #555;
  93. /* font-size: 0.35rem; */
  94. display: grid;
  95. place-content: center;
  96. place-items: center;
  97. font-size: 0.16rem;
  98. }
  99. footer a span:first-of-type {
  100. color: red;
  101. font-size: 0.30rem;
  102. }
  103. main {
  104. height: 2000px;
  105. /* background-color: red; */
  106. position: relative;
  107. top: 50px;
  108. margin-top: 0.08rem;
  109. /* padding: 0 0 0.03rem 0; */
  110. /* margin-bottom: 2rem; */
  111. }
  112. main ul:first-of-type{
  113. display: grid;
  114. grid-template-columns:repeat(5,1fr);
  115. /* grid-template-rows: repeat(2,); */
  116. place-items: center;
  117. place-content: center;
  118. background-color: white;
  119. /* gap: 0 0.1rem; */
  120. border-radius: 0.1rem;
  121. margin-top: 0.08rem;
  122. }
  123. main .navs1 .item {
  124. display: grid;
  125. /* 文字对齐 */
  126. place-items: center;
  127. /* background-color: aqua; */
  128. /* gap: 0 1rem; */
  129. }
  130. main ul li span {
  131. /* background-color: #ff5f00; */
  132. color: #666666;
  133. /* font-size: 0.12rem; */
  134. /* place-items: center;
  135. place-content: center; */
  136. /* place-self: center; */
  137. /* gap: 0 0.1rem; */
  138. /* padding: 0.1rem ; */
  139. margin-top: 0.05rem;
  140. /* gap: 0 0.1rem; */
  141. }
  142. main .entry {
  143. display: grid;
  144. grid-template-columns: repeat(2, 1fr);
  145. padding: 0.1rem;
  146. background-color: white;
  147. border-radius: 0.1rem;
  148. margin-top: 0.08rem;
  149. /* padding: 0.1rem; */
  150. }
  151. main .entry .item {
  152. display: grid;
  153. grid-template-columns: repeat(2, 1fr);
  154. padding: 0.1rem;
  155. }
  156. main .entry .item .title {
  157. grid-column: span 2;
  158. display: flex;
  159. place-items: center;
  160. }
  161. /* 调整标签字体样式 */
  162. main .entry .item .title span{
  163. background-color: #ff5000;
  164. color: white;
  165. border-radius: 0.05rem;
  166. font-size: smaller;
  167. padding: 0 0.03rem;
  168. margin-left: 0.05rem;
  169. }
  170. /* 增加下边框 */
  171. main .entry .item:nth-of-type(-n + 2) {
  172. border-bottom: 1px solid #dedede;
  173. }
  174. main .list {
  175. display: grid;
  176. grid-template-columns: repeat(2,1fr);
  177. /* background-color: white; */
  178. /* border-radius: 0.1rem ; */
  179. margin-top: 0.08rem;
  180. gap: 0 0.1rem;
  181. }
  182. main .list .item img {
  183. /* 图片的border-radius: 上 右 下 左; 顺时针 */
  184. border-radius: 0.1rem 0.1rem 0 0;
  185. }
  186. /* 商品描述 */
  187. main .list .desc {
  188. padding: 0.1rem;
  189. font-size: smaller;
  190. }
  191. /* 价格 */
  192. main .list .item .price .iconfont {
  193. color: #f50;
  194. font-size: smaller;
  195. }
  196. main .list .item .price span:last-of-type {
  197. color: #bbb;
  198. font-size: smaller;
  199. }
  200. </style>

效果

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!