Blogger Information
Blog 17
fans 0
comment 0
visits 6203
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿写手淘首页页脚与主体
生活需要加油
Original
410 people have browsed it

仿写手淘首页页脚与主体

1. 仿写页脚与主体

页面效果:

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="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/public.css" />
  13. <!-- 主体顶部导航 -->
  14. <!-- <link rel="stylesheet" href="css/main.css" /> -->
  15. <!-- 现在只需要加载一个index.css -->
  16. <!-- <link rel="stylesheet" href="css/index.css" /> -->
  17. <style>
  18. /* 在style标签中, 如果用import,import必须在顶部 */
  19. /* @import url('css/index.css'); */
  20. </style>
  21. </head>
  22. <body>
  23. <!-- 1. 页眉 -->
  24. <header>
  25. <!-- 1. LOGO -->
  26. <a class="logo" href="https://m.taobao.com"
  27. ><img src="images/taobao.png" alt=""
  28. /></a>
  29. <!-- 2. 搜索框 -->
  30. <a href="" class="search">
  31. <span>寻找宝贝店铺</span>
  32. <span>搜索</span>
  33. </a>
  34. <!-- 3. 签到图标 -->
  35. <a href="" class="iconfont icon-qiandao-xuanzhong"></a>
  36. </header>
  37. <!-- 2. 主体 -->
  38. <main>
  39. <!-- 1. 顶部导航 -->
  40. <ul class="navs">
  41. <li class="item">
  42. <a href=""><img src="images/navs/tmxb.webp" alt="" /></a>
  43. <a href="">天猫新品</a>
  44. </li>
  45. <li class="item">
  46. <a href=""><img src="images/navs/jrbk.webp" alt="" /></a>
  47. <a href="">今日爆款</a>
  48. </li>
  49. <li class="item">
  50. <a href=""><img src="images/navs/tmgj.webp" alt="" /></a>
  51. <a href="">天猫国际</a>
  52. </li>
  53. <li class="item">
  54. <a href=""><img src="images/navs/fzlx.webp" alt="" /></a>
  55. <a href="">飞猪旅行</a>
  56. </li>
  57. <li class="item">
  58. <a href=""><img src="images/navs/tmcx.webp" alt="" /></a>
  59. <a href="">天猫超市</a>
  60. </li>
  61. <li class="item">
  62. <a href=""><img src="images/navs/tbch.webp" alt="" /></a>
  63. <a href="">淘宝吃货</a>
  64. </li>
  65. <li class="item">
  66. <a href=""><img src="images/navs/sqk.webp" alt="" /></a>
  67. <a href="">省钱卡</a>
  68. </li>
  69. <li class="item">
  70. <a href=""><img src="images/navs/ltjb.webp" alt="" /></a>
  71. <a href="">领淘金币</a>
  72. </li>
  73. <li class="item">
  74. <a href=""><img src="images/navs/alpm.webp" alt="" /></a>
  75. <a href="">阿里拍卖</a>
  76. </li>
  77. <li class="item">
  78. <a href=""><img src="images/navs/fl.webp" alt="" /></a>
  79. <a href="">分类</a>
  80. </li>
  81. </ul>
  82. <!-- 2. 快速入口 -->
  83. <ul class="entry">
  84. <li class="item">
  85. <div class="title">
  86. <h3>聚划算</h3>
  87. <span>品牌折扣</span>
  88. </div>
  89. <a href=""><img src="images/items/item-1.webp" alt="" /></a>
  90. <a href=""><img src="images/items/item-2.webp" alt="" /></a>
  91. </li>
  92. <li class="item">
  93. <div class="title">
  94. <h3>天天特卖</h3>
  95. <span>1元秒杀</span>
  96. </div>
  97. <a href=""><img src="images/items/item-3.webp" alt="" /></a>
  98. <a href=""><img src="images/items/item-4.webp" alt="" /></a>
  99. </li>
  100. <li class="item">
  101. <div class="title">
  102. <h3>有好货</h3>
  103. <span style="background-color: deepskyblue">好口碑</span>
  104. </div>
  105. <a href=""><img src="images/items/item-5.webp" alt="" /></a>
  106. <a href=""><img src="images/items/item-6.webp" alt="" /></a>
  107. </li>
  108. <li class="item">
  109. <div class="title">
  110. <h3>每日好店</h3>
  111. <span style="background-color: orange">特色</span>
  112. </div>
  113. <a href=""><img src="images/items/item-7.webp" alt="" /></a>
  114. <a href=""><img src="images/items/item-8.webp" alt="" /></a>
  115. </li>
  116. </ul>
  117. <!-- 3. 商品列表 -->
  118. <ul class="list">
  119. <li class="item">
  120. <!-- 图片 -->
  121. <a href=""><img src="images/items/item-9.webp" alt="" /></a>
  122. <!-- 描述 -->
  123. <div class="desc">
  124. <a href="">商品简介商品简介商品简介商品简介商品简介</a>
  125. <div class="price">
  126. <span class="iconfont icon-renminbi_o">14.9</span>
  127. </div>
  128. </div>
  129. </li>
  130. <li class="item">
  131. <a href=""><img src="images/items/item-10.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="images/items/item-11.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. </li>
  150. <li class="item">
  151. <a href=""><img src="images/items/item-12.webp" alt="" /></a>
  152. <div class="desc">
  153. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  154. <div class="price">
  155. <span class="iconfont icon-renminbi_o">288</span>
  156. <span>123人已购买</span>
  157. </div>
  158. </div>
  159. </li>
  160. <li class="item">
  161. <a href=""><img src="images/items/item-13.webp" alt="" /></a>
  162. <div class="desc">
  163. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  164. <div class="price">
  165. <span class="iconfont icon-renminbi_o">288</span>
  166. <span>123人已购买</span>
  167. </div>
  168. </div>
  169. </li>
  170. <li class="item">
  171. <a href=""><img src="images/items/item-14.webp" alt="" /></a>
  172. <div class="desc">
  173. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  174. <div class="price">
  175. <span class="iconfont icon-renminbi_o">288</span>
  176. <span>123人已购买</span>
  177. </div>
  178. </div>
  179. </li>
  180. <li class="item">
  181. <a href=""><img src="images/items/item-15.webp" alt="" /></a>
  182. <div class="desc">
  183. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  184. <div class="price">
  185. <span class="iconfont icon-renminbi_o">288</span>
  186. <span>123人已购买</span>
  187. </div>
  188. </div>
  189. </li>
  190. <li class="item">
  191. <a href=""><img src="images/items/item-16.webp" alt="" /></a>
  192. <div class="desc">
  193. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  194. <div class="price">
  195. <span class="iconfont icon-renminbi_o">288</span>
  196. <span>123人已购买</span>
  197. </div>
  198. </div>
  199. </li>
  200. <li class="item">
  201. <a href=""><img src="images/items/item-17.webp" alt="" /></a>
  202. <div class="desc">
  203. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  204. <div class="price">
  205. <span class="iconfont icon-renminbi_o">288</span>
  206. <span>123人已购买</span>
  207. </div>
  208. </div>
  209. </li>
  210. <li class="item">
  211. <a href=""><img src="images/items/item-18.webp" alt="" /></a>
  212. <div class="desc">
  213. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  214. <div class="price">
  215. <span class="iconfont icon-renminbi_o">288</span>
  216. <span>123人已购买</span>
  217. </div>
  218. </div>
  219. </li>
  220. <li class="item">
  221. <a href=""><img src="images/items/item-19.webp" alt="" /></a>
  222. <div class="desc">
  223. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  224. <div class="price">
  225. <span class="iconfont icon-renminbi_o">288</span>
  226. <span>123人已购买</span>
  227. </div>
  228. </div>
  229. </li>
  230. <li class="item">
  231. <a href=""><img src="images/items/item-20.webp" alt="" /></a>
  232. <div class="desc">
  233. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  234. <div class="price">
  235. <span class="iconfont icon-renminbi_o">288</span>
  236. <span>123人已购买</span>
  237. </div>
  238. </div>
  239. </li>
  240. <li class="item">
  241. <a href=""><img src="images/items/item-21.webp" alt="" /></a>
  242. <div class="desc">
  243. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  244. <div class="price">
  245. <span class="iconfont icon-renminbi_o">288</span>
  246. <span>123人已购买</span>
  247. </div>
  248. </div>
  249. </li>
  250. <li class="item">
  251. <a href=""><img src="images/items/item-22.webp" alt="" /></a>
  252. <div class="desc">
  253. <a href="">商品描述商品描述商品描述商品描述商品描述</a>
  254. <div class="price">
  255. <span class="iconfont icon-renminbi_o">288</span>
  256. <span>123人已购买</span>
  257. </div>
  258. </div>
  259. </li>
  260. </ul>
  261. </main>
  262. <!-- 3. 页脚 -->
  263. <footer>
  264. <a href="m.taobao.com" class="iconfont icon-taobao"></a>
  265. <a href="">
  266. <span class="iconfont icon-gouwuche"></span>
  267. <span>购物车</span>
  268. </a>
  269. <a href="">
  270. <span class="iconfont icon-wode"></span>
  271. <span>我的淘宝</span>
  272. </a>
  273. </footer>
  274. </body>
  275. </html>

footer.css

  1. footer {
  2. display: grid;
  3. /* 1行3列 */
  4. grid-template-columns: repeat(3, 1fr);
  5. grid-auto-rows: 0.5rem;
  6. place-items: center;
  7. /* gap: 0.1rem; */
  8. }
  9. footer > a.iconfont {
  10. color: #ff5000;
  11. font-size: 0.4rem;
  12. }
  13. footer > a:first-child + * {
  14. display: flex;
  15. flex-flow: column nowrap;
  16. place-content: center;
  17. }
  18. footer > a:first-child + * > span.iconfont {
  19. font-size: 0.25rem;
  20. place-self: center;
  21. }
  22. /* footer > a:first-child + * > span.iconfont + * {
  23. font-size: 0.1rem;
  24. } */
  25. footer > a:last-child {
  26. display: flex;
  27. flex-flow: column nowrap;
  28. place-content: center;
  29. }
  30. footer > a:last-child > span.iconfont {
  31. font-size: 0.25rem;
  32. place-self: center;
  33. }
  34. footer > a:last-child > span.iconfont + * {
  35. font-size: 0.1rem;
  36. }
  37. header,
  38. footer {
  39. background-color: #f4f4f4;
  40. }

public.css

  1. main > .navs {
  2. display: grid;
  3. grid-template-columns: repeat(5, 1fr);
  4. grid-template-rows: repeat(2, 1fr);
  5. place-content: center;
  6. border-radius: 0.1rem;
  7. background-color: white;
  8. }
  9. main > .navs > .item {
  10. text-align: center;
  11. }
  12. ul.entry {
  13. display: grid;
  14. grid-template-columns: repeat(2, 1fr);
  15. grid-template-rows: repeat(2, 1fr);
  16. border-radius: 0.1rem;
  17. overflow: hidden;
  18. margin-top: 10px;
  19. gap: 0.02rem;
  20. }
  21. ul.entry > .item {
  22. display: flex;
  23. background-color: white;
  24. }
  25. ul.entry > .item > a {
  26. place-self: end;
  27. }
  28. ul.entry > .item > .title {
  29. position: absolute;
  30. display: flex;
  31. flex-flow: row nowrap;
  32. }
  33. ul.entry > .item > .title > h3 {
  34. font-size: 18px;
  35. }
  36. ul.entry > .item > .title > span {
  37. font-size: 10px;
  38. place-self: end;
  39. background-color: #fe4200;
  40. border-radius: 0.05rem;
  41. padding: 0.02rem 0.05rem;
  42. color: white;
  43. }
  44. ul.list {
  45. display: grid;
  46. grid-template-columns: repeat(2, 1fr);
  47. grid-template-rows: repeat(11, 1fr);
  48. margin-top: 10px;
  49. gap: 0.05rem;
  50. }
  51. ul.list > li.item {
  52. border-radius: 0.1rem;
  53. overflow: hidden;
  54. gap: 0.05rem;
  55. }
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