Answer the question
In order to leave comments, you need to log in
How to achieve auto block width with position: absolute; depending on the text inside with a limit of max. width?
There is a task to make a custom tooltip on hover in the sandbox of the code.
The problem is that you need to set the maximum width that the tooltip block can have, and until that moment the block should be of automatic width, therefore, when the max width is reached, the text inside should adjust and wrap.
If we remove the white-space: pre; then the words will be wrapped after each word and there will be a column of words, which is not very acceptable.
Help solve this problem
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