P
P
Programmir2018-05-07 14:19:00
css
Programmir, 2018-05-07 14:19:00

Is it possible to make the parent block take the height of the full image via css?

There is a picture and text on it. I make the image absolutely positioned, but then the parent box has no height. And I calculate the height of the image using jquery and set it to the parent block. And if you do it through the background, then the picture will simply correspond to the height of this block and will be cropped. Is it possible to make using css so that the image is fully shown in height and the parent block is equal to the height of the entire image?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ArtGenSky, 2018-05-07
@ArtGenSky

Yes, don't position the image absolutely. In any case, without more information about the case, it will be difficult to advise you anything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question