博客列表 >淘宝移动端首页的商品列表

淘宝移动端首页的商品列表

阿杰
阿杰原创
2022年03月31日 17:00:44421浏览

商品列表

  • html部分
  1. <!-- 商品列表 -->
  2. <div class="list">
  3. <div class="title">------ <span class="iconfont icon-xihuan"></span>你可能还喜欢 ------</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"><span class="iconfont icon-rmb">68</span><span class="num">55人已购买</span></div>
  11. </div>
  12. </div>
  13. <div class="unit">
  14. <div class="img">
  15. <img src="images/items/item8.webp" alt="" />
  16. </div>
  17. <div class="detail">
  18. <div class="desc">北美红雀冬青浆果欧式陶瓷餐具汤锅汤碗汤盆手绘浮雕彩绘带盖耐热</div>
  19. <div class="price"><span class="iconfont icon-rmb">68</span><span class="num">55人已购买</span></div>
  20. </div>
  21. </div>
  22. <div class="unit">
  23. <div class="img">
  24. <img src="images/items/item8.webp" alt="" />
  25. </div>
  26. <div class="detail">
  27. <div class="desc">北美红雀冬青浆果欧式陶瓷餐具汤锅汤碗汤盆手绘浮雕彩绘带盖耐热</div>
  28. <div class="price"><span class="iconfont icon-rmb">68</span><span class="num">55人已购买</span></div>
  29. </div>
  30. </div>
  31. <div class="unit">
  32. <div class="img">
  33. <img src="images/items/item8.webp" alt="" />
  34. </div>
  35. <div class="detail">
  36. <div class="desc">北美红雀冬青浆果欧式陶瓷餐具汤锅汤碗汤盆手绘浮雕彩绘带盖耐热</div>
  37. <div class="price"><span class="iconfont icon-rmb">68</span><span class="num">55人已购买</span></div>
  38. </div>
  39. </div>
  40. </div>
  • css部分
  1. main .list{
  2. display: grid;
  3. grid-template-columns: repeat(2,1fr);
  4. margin-top: 0.1rem;
  5. gap: 0.1rem;
  6. }
  7. main .list .title{
  8. grid-column: span 2;
  9. text-align: center;
  10. color: #ff5500;
  11. font-size: larger;
  12. padding: 0.1rem 0;
  13. }
  14. main .list .unit{
  15. display: grid;
  16. border-radius: 0.06rem;
  17. background-color: #fff;
  18. overflow: hidden;
  19. }
  20. main .list .unit .detail{
  21. display: grid;
  22. padding: 0.1rem;
  23. }
  24. main .list .unit .detail .desc{
  25. font-size: 0.1rem;
  26. line-height: 0.2rem;
  27. overflow: hidden;
  28. text-overflow: ellipsis;
  29. display: -webkit-box;
  30. -webkit-line-clamp: 2;
  31. -webkit-box-orient: vertical;
  32. }
  33. main .list .unit .detail .price{
  34. display: grid;
  35. color: #ff5500;
  36. grid-template-columns: repeat(2,1fr);
  37. line-height: 0.2rem;
  38. }
  39. main .list .unit .detail .price span:first-of-type{
  40. place-items: center end;
  41. }
  42. main .list .unit .detail .price span:last-of-type{
  43. place-items: center end;
  44. color: #999;
  45. }
  • 效果图如下

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