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>
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>
You should add this line to your CSS
word-wrap: break-word;
Buy default white-space: wrap; Just Set white-space
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.