How to implement using css when one block is displayed, depending on the length of another block?

Hello!

How to implement using css when one block is displayed, depending on the length of another block ?

Ie "block1" and "block2" so as to make "block2" being on the same level near ottalkivaemsya from the borders of another block depending on the length, clung to him and Vice versa was removed and not climb on it.

5e316e339d1ab807828107.png
April 4th 20 at 14:20
2 answers
April 4th 20 at 14:22
Solution
April 4th 20 at 14:24
Solution

Find more questions by tags HTMLCSS