productList.css 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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(4,365px);
  32. grid-gap: 25px;
  33. box-sizing: border-box;
  34. }
  35. .product{
  36. display: block;
  37. width: 100%;
  38. height: 380px;
  39. background-color: #fff;
  40. box-shadow: 1px 1px 3px black;
  41. border-radius: 3px;
  42. overflow: hidden;
  43. cursor: pointer;
  44. position: relative;
  45. margin-bottom: 0;
  46. }
  47. }
  48. .product:hover{
  49. box-shadow: 1px 1px 5px #3a3838;
  50. }
  51. .product .more{
  52. background-color: #912b02;
  53. padding: 0 30px;
  54. border-radius: 4px;
  55. display: block;
  56. position: absolute;
  57. left: 50%;
  58. transform: translate(-50%,0);
  59. top: 250px;
  60. opacity: 0;
  61. transition:all 0.5s;
  62. color: white;
  63. }
  64. .product:hover .more{
  65. opacity: 1;
  66. background-color: orangered;
  67. }
  68. .product .more:hover{
  69. box-shadow: 1px 1px 5px white;
  70. padding: 0 25px;
  71. }
  72. .product .product-info{
  73. display: block;
  74. padding: 5px;
  75. height: calc(100% - 270px);
  76. box-sizing: border-box;
  77. }
  78. .product:hover .imgBox img{
  79. left: -10px;
  80. top: -10px;
  81. max-width: calc(100% + 20px);
  82. width: calc(100% + 20px);
  83. height: calc(100% + 20px);
  84. }
  85. .product .title{
  86. height: 40px;
  87. display: flex;
  88. align-items: center;
  89. font-size: 1.6em;
  90. }
  91. .product-info .description{
  92. display: block;
  93. height: calc(100% - 40px);
  94. border-top: 1px solid beige;
  95. font-size: 0.9em;
  96. color: #444343;
  97. }
  98. .product-info .description > span{
  99. display: block;
  100. }