0

I have a tooltip that's width is based on the size of the content:

I have given this container a max-width of 400:

What happens is the text wraps to fit in the 400px container. Because it breaks on word, it causes this big white space to the right of the container. Are there any ways to shrink the container to now fit this text? The text element is not the full width:

Alex Gurr
  • 503
  • 1
  • 6
  • 20
  • try `word-break: break-all:` in the container – Danielprabhakaran N Sep 26 '21 at 03:33
  • DanielprabhakaranN - I don't want to break the words. I want the container to shrink to match the wrapping. Whip - Not sure it's your judgement call as to the goal of my build/design! I don't want the text aligned differently, nor a fixed width. – Alex Gurr Sep 26 '21 at 04:16
  • Can you provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), please? – Anton Sep 26 '21 at 06:08

0 Answers0