I am implementing a tooltip with CSS. I have the following styles applied to it
width: auto ;
max-width: 400px;
white-space: normal;
word-break: break-word;
height: auto;
It works fine but I have specific case where I would like it to behave slightly different.
Case: The last word of a line is long enough that it cannot be accommodated in the max width of 400px without breaking it. Thus the word breaks into the next line and rest all text space out accordingly.
But the space in which this word was tried to be accommodated did not shrink. So visually it appears that more padding is added at the right, but this was the effect of the larger word breaking into the next line. Any idea to resize the tooltip if a word breaks into the next line at max-width?