Why doesn't a text inside flex element wraps? [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why doesn't a text inside flex element wraps? [SOLVED]

Why doesn't a text inside flex element wraps if it's typed without any white space (sometextwithoutwhitespace.....). But it works fine if you type with white spaces. I can't figure it out. The HTML structure is this: <body> <div id = "body"> <div class = "tdLists"> <p> todo item </p> <img src = "......." /> </div> </div> </body> https://code.sololearn.com/WqkG4ic0Tk6M/?ref=app

2nd Nov 2021, 10:25 AM
Artur
Artur - avatar
4 Answers
+ 2
You need to use word-break: break-word on your .tdLists, this will make text with no whitespace to break
2nd Nov 2021, 11:24 AM
PanicS
PanicS - avatar
+ 1
Sanja Panic Yep it works. I've never heard about word-break property to be honest. Thank you very much.
2nd Nov 2021, 12:06 PM
Artur
Artur - avatar
+ 1
I also didnt heard, i tried with word-wrap and this one didnt work for some reason. So i looked for something else. So i also learned something new 😄
2nd Nov 2021, 3:21 PM
PanicS
PanicS - avatar