D
D
Duni2022-01-19 15:36:00
css
Duni, 2022-01-19 15:36:00

Why doesn't the webp image adapt to the height of the parent block?






product2.png




.item-product__preview {
position: relative;
&:before {
content: "";
display:block;
padding top: 92%
}
&-image {
position: absolute;
top: 0;
left: 0;
width: 100%
height: 100%;
display:flex;
justify-content: center;
align-items: center;
img {
display: block;
max-width: 100%
max-height: 100%
}
}
I don’t know how correct this is, but I tried to write display: block; max-height: 100% for picture but nothing helps. If you remove the picture tag and add the image only through img, then everything works as it should.61e80506d3842660272958.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question