Answer the question
In order to leave comments, you need to log in
How to stretch the block to the width of the image?
Good time!
There is a block with text, which can contain a picture (the dimensions of the picture are not known in advance). The minimum block size is 200px, the maximum is 400. It is necessary that the block always be the minimum size, but only as long as there is no image in it. The same block with an image should stretch across its width, but up to a maximum of 400px.
If I set max-width, the block tends to stretch to the full width at once, regardless of the presence of the image and its size.
Maybe someone came across how to do this?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question