I have an Html text and want to show it in a div like below
<div dangerouslySetInnerHTML={{ __html: THETEXT }} />
It shows in one line without any breaking, what should I do for showing in correct way with line breaking?
Html Text:
<p><span style="color: rgb(26, 26, 27);"> for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a for a</span></p>
I want to show like this (means have line breaking)

CodePudding user response:
You should add this line to your CSS
word-wrap: break-word;
CodePudding user response:
CSS white-space.
<p style="white-space: nowrap">I'm a big long line that won't wrap. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.</p>
<p>I'm a big long line that wraps. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.</p>
CodePudding user response:
Buy default white-space: wrap; Just Set white-space

