Discussion on word-break of CSS

generally, when you use word-break, you need to add width and work properly,
but what I need to achieve is that the width auto, is set to the maximum.

is actually a chat message. The message sent by the user can be long or short, and then the pure number does not wrap. You need to use the word-break style restriction.
if you do not write the width of div, entering two digits will also wrap the line, and entering a long number is normal.

could you tell me how to solve this?

< div class= "" style= "word-wrap:break-word;word-break:break-all;" > 111111 < / div >

Mar.12,2021
Menu