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

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

Time
Time原创
2022年04月01日 16:08:43446浏览

图片

taobao-index

代码

HTML代码

  1. <div class="list">
  2. <div class="title"><img src="images/items/like.png" alt="" /></div>
  3. <div class="content">
  4. <div class="item">
  5. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  6. <a href="">
  7. <div class="item-title">
  8. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  9. </div>
  10. <div class="item-content">
  11. <span></span>
  12. <span>59.8</span>
  13. <span>23人已购买</span>
  14. </div>
  15. </a>
  16. </div>
  17. <div class="item">
  18. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  19. <a href="">
  20. <div class="item-title">
  21. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  22. </div>
  23. <div class="item-content">
  24. <span></span>
  25. <span>59.8</span>
  26. <span>23人已购买</span>
  27. </div>
  28. </a>
  29. </div>
  30. <div class="item">
  31. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  32. <a href="">
  33. <div class="item-title">
  34. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  35. </div>
  36. <div class="item-content">
  37. <span></span>
  38. <span>59.8</span>
  39. <span>23人已购买</span>
  40. </div>
  41. </a>
  42. </div>
  43. <div class="item">
  44. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  45. <a href="">
  46. <div class="item-title">
  47. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  48. </div>
  49. <div class="item-content">
  50. <span></span>
  51. <span>59.8</span>
  52. <span>23人已购买</span>
  53. </div>
  54. </a>
  55. </div>
  56. <div class="item">
  57. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  58. <a href="">
  59. <div class="item-title">
  60. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  61. </div>
  62. <div class="item-content">
  63. <span></span>
  64. <span>59.8</span>
  65. <span>23人已购买</span>
  66. </div>
  67. </a>
  68. </div>
  69. <div class="item">
  70. <a href=""><img src="images/items/qiqiu.jpg_.webp" alt="" /></a>
  71. <a href="">
  72. <div class="item-title">
  73. <span>日本进口伊陶日式家用盘陶瓷餐具汤菜盘子水果沙拉</span>
  74. </div>
  75. <div class="item-content">
  76. <span></span>
  77. <span>59.8</span>
  78. <span>23人已购买</span>
  79. </div>
  80. </a>
  81. </div>
  82. </div>
  83. </div>

css代码

  1. main .list {
  2. margin-bottom: 0.46rem;
  3. display: grid;
  4. grid-template-rows: 0.46rem 1fr;
  5. place-items: center;
  6. }
  7. /* main .list img {
  8. width: 100%;
  9. } */
  10. main .list .title img {
  11. width: 1.54rem;
  12. height: 0.18rem;
  13. }
  14. main .list .content {
  15. display: grid;
  16. grid-template-columns: repeat(2, 1fr);
  17. gap: 0.0716rem 0.1145rem;
  18. }
  19. main .list .content .item img {
  20. width: 100%;
  21. height: 100%;
  22. border-top-left-radius: 0.0573rem;
  23. border-top-right-radius: 0.0573rem;
  24. }
  25. main .list .content .item {
  26. display: grid;
  27. grid-template-rows: 1.64rem 1fr;
  28. background-color: #fff;
  29. height: 2.5rem;
  30. }
  31. main .list .content .item a:last-of-type {
  32. display: grid;
  33. grid-template-rows: 0.5531rem 1fr;
  34. place-items: center start;
  35. padding: 0 0.086rem 0 0.0954rem;
  36. }
  37. main .list .content .item .item-title {
  38. font-size: 0.1241rem;
  39. color: #333;
  40. }
  41. main .list .content .item .item-content > span:nth-of-type(-n + 2) {
  42. color: #ff5500;
  43. }
  44. main .list .content .item .item-content > span:last-of-type {
  45. color: #999999;
  46. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议