Make a .div act like an image

后端 未结 2 1402
长情又很酷
长情又很酷 2021-01-23 23:41

I have a question about the display of a container.

First, I managed to simulate the attribute \"object-fit: contain;\" for an image by using a verticaly alligned strut

2条回答
  •  青春惊慌失措
    2021-01-24 00:25

    Since .descriptionBox has position: absolute; the (surrounding) .container should probably have position:relative;

    https://codepen.io/eye-wonder/pen/EKGPmZ

提交回复
热议问题