productList.css 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .productCenter{
  2. display: flex;
  3. flex-direction: column;
  4. box-sizing: border-box;
  5. align-items: center;
  6. }
  7. .product{
  8. display: flex;
  9. flex-direction: column;
  10. width: 96%;
  11. /*height: 380px;*/
  12. aspect-ratio:310/380;
  13. background-color: #fff;
  14. box-shadow: 1px 1px 3px black;
  15. border-radius: 3px;
  16. overflow: hidden;
  17. cursor: pointer;
  18. position: relative;
  19. margin-bottom: 10px;
  20. }
  21. .product .imgBox{
  22. display: block;
  23. width: 100%;
  24. /*height: 270px;*/
  25. aspect-ratio:310/230;
  26. flex-shrink: 1;
  27. }
  28. @media screen and (min-width: 1024px) {
  29. .productCenter{
  30. display: grid;
  31. grid-template-columns: repeat(auto-fill, 365px);
  32. grid-gap: 25px;
  33. box-sizing: border-box;
  34. justify-content: center;
  35. }
  36. .product{
  37. display: block;
  38. width: 100%;
  39. height: 380px;
  40. background-color: #fff;
  41. box-shadow: 1px 1px 3px black;
  42. border-radius: 3px;
  43. overflow: hidden;
  44. cursor: pointer;
  45. position: relative;
  46. margin-bottom: 0;
  47. }
  48. }
  49. .product:hover{
  50. box-shadow: 1px 1px 5px #3a3838;
  51. }
  52. .product .more{
  53. background-color: #912b02;
  54. padding: 0 30px;
  55. border-radius: 4px;
  56. display: block;
  57. position: absolute;
  58. left: 50%;
  59. transform: translate(-50%,0);
  60. top: 250px;
  61. opacity: 0;
  62. transition:all 0.5s;
  63. color: white;
  64. }
  65. .product:hover .more{
  66. opacity: 1;
  67. background-color: orangered;
  68. }
  69. .product .more:hover{
  70. box-shadow: 1px 1px 5px white;
  71. padding: 0 25px;
  72. }
  73. .product .product-info{
  74. display: block;
  75. padding: 5px;
  76. height: calc(100% - 270px);
  77. box-sizing: border-box;
  78. }
  79. .product:hover .imgBox img{
  80. left: -10px;
  81. top: -10px;
  82. max-width: calc(100% + 20px);
  83. width: calc(100% + 20px);
  84. height: calc(100% + 20px);
  85. }
  86. .product .title{
  87. height: 40px;
  88. display: flex;
  89. align-items: center;
  90. font-size: 1.6em;
  91. }
  92. .product-info .description{
  93. display: block;
  94. height: calc(100% - 40px);
  95. border-top: 1px solid beige;
  96. font-size: 0.9em;
  97. color: #444343;
  98. }
  99. .product-info .description > span{
  100. display: block;
  101. }