Skip to content

How To Keep Original Format of Text by CSS

white-space: pre-wrap

Of course, you can use <pre> to keep the format:

<pre>
...
</pre>

But the question is, it will not wrap the line when text overflow, so the best way is to add a CSS property in the <p>

<p style="white-space: pre-wrap;">
...
</p>

Leave a Reply

Your email address will not be published. Required fields are marked *