.productCenter{ display: flex; flex-direction: column; box-sizing: border-box; align-items: center; } .product{ display: flex; flex-direction: column; width: 96%; /*height: 380px;*/ aspect-ratio:310/380; background-color: #fff; box-shadow: 1px 1px 3px black; border-radius: 3px; overflow: hidden; cursor: pointer; position: relative; margin-bottom: 10px; } .product .imgBox{ display: block; width: 100%; /*height: 270px;*/ aspect-ratio:310/230; flex-shrink: 1; } @media screen and (min-width: 1024px) { .productCenter{ display: grid; grid-template-columns: repeat(4,365px); grid-gap: 25px; box-sizing: border-box; } .product{ display: block; width: 100%; height: 380px; background-color: #fff; box-shadow: 1px 1px 3px black; border-radius: 3px; overflow: hidden; cursor: pointer; position: relative; margin-bottom: 0; } } .product:hover{ box-shadow: 1px 1px 5px #3a3838; } .product .more{ background-color: #912b02; padding: 0 30px; border-radius: 4px; display: block; position: absolute; left: 50%; transform: translate(-50%,0); top: 250px; opacity: 0; transition:all 0.5s; color: white; } .product:hover .more{ opacity: 1; background-color: orangered; } .product .more:hover{ box-shadow: 1px 1px 5px white; padding: 0 25px; } .product .product-info{ display: block; padding: 5px; height: calc(100% - 270px); box-sizing: border-box; } .product:hover .imgBox img{ left: -10px; top: -10px; max-width: calc(100% + 20px); width: calc(100% + 20px); height: calc(100% + 20px); } .product .title{ height: 40px; display: flex; align-items: center; font-size: 1.6em; } .product-info .description{ display: block; height: calc(100% - 40px); border-top: 1px solid beige; font-size: 0.9em; color: #444343; } .product-info .description > span{ display: block; }