example where problem

So, the problem is that the block that in the screenshot matches the size relative to the text, but it’s necessary that it would be based on the size of the large image, and the text was already adjusted to the given size. The image is wrapped in a block with an inline-block, the block with the text is an html p tag, parents do not have the size and adapt to the size of the internal content, so all the rules are there.

Example in the form of code:

<div class="container" style="background: blue; text-align: center;"> <div class="image" style="width: 300px; height: 700px; background: yellow; display: inline-block"></div> <p>Вставьте изображение, чтобы оно там было и все будет хорошо</p> </div> 

0