Blogger Information
Blog 15
fans 1
comment 1
visits 174232
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
淘宝移动端布局商品列表
想做肥仔
Original
1075 people have browsed it

HTML部分

  1. <!-- 2. 商品列表 -->
  2. <div class="list">
  3. <div class="title">------你可能还喜欢------</div>
  4. <div class="unit">
  5. <div class="img">
  6. <img src="images/items/item8.webp" alt="" />
  7. </div>
  8. <div class="detail">
  9. <div class="desc">野生绿植,自然生态,居家必备,易养易活 </div>
  10. <div class="price">
  11. <span class="iconfont icon-rmb">35</span>
  12. <span class="num">1056人已购买</span>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="unit">
  17. <div class="img">
  18. <img src="images/items/item20.webp" alt="" />
  19. </div>
  20. <div class="detail">
  21. <div class="desc">2米超大天鹅丝绸被褥,盖的顺心,睡的舒 心</div>
  22. <div class="price">
  23. <span class="iconfont icon-rmb">85</span>
  24. <span class="num">21546人已购买</span>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="unit">
  29. <div class="img">
  30. <img src="images/items/item14.webp" alt="" />
  31. </div>
  32. <div class="detail">
  33. <div class="desc">2米超大天鹅丝绸被褥,盖的顺心,睡的舒 心</div>
  34. <div class="price">
  35. <span class="iconfont icon-rmb">80</span>
  36. <span class="num">31510人已购买</span>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="unit">
  41. <div class="img">
  42. <img src="images/items/item15.webp" alt="" />
  43. </div>
  44. <div class="detail">
  45. <div class="desc">超大海碗,经此匠工,纯白品质,优选放心 </div>
  46. <div class="price">
  47. <span class="iconfont icon-rmb">29</span>
  48. <span class="num">8466人已购买</span>
  49. </div>
  50. </div>
  51. </div>
  52. </div>

CSS部分

  1. /* 商品列表 */
  2. main .list {
  3. display: grid;
  4. grid-template-columns: repeat(2,1fr);
  5. gap: 0.1rem;
  6. padding: 0.1rem 0 0.5rem 0;
  7. }
  8. /* text-align: center文字居中属性 */
  9. main .list .title {
  10. grid-column: span 2;
  11. font-size: 0.15rem;
  12. color: coral;
  13. text-align: center;
  14. }
  15. main .list .unit {
  16. background-color: #fff;
  17. border-radius: 0.1rem;
  18. display: grid;
  19. }
  20. main .list .unit img {
  21. border-radius: 0.1rem 0.1rem 0 0;
  22. width: 100%;
  23. height: 100%;
  24. }
  25. main .list .unit .detail {
  26. padding: 0.1rem;
  27. display: grid;
  28. gap: 0.12rem;
  29. }
  30. /* ¥图标 */
  31. main .list .unit .price .iconfont {
  32. color: coral;
  33. font-size: large;
  34. margin-right: 0.1rem;
  35. }
  36. main .list .unit .price .num {
  37. color: #ccc;
  38. }

效果示例图

效果示例

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