Reputation:
The text in my source code is formatted properly, but when it shows up in the browser all the formatting disappears. Is there a tag I could add to the paragraph tag to make the text properly format?
Upvotes: 1
Views: 114
Reputation: 3021
<div style="white-space:pre"> hereIsSomeSourceCode(); if (blah == 3) doSomething(); </div>
Upvotes: 2
Reputation: 2377
you could use the <pre> and </pre> tags to preserve formatting instead of the <p> tag
<pre>
</pre>
<p>
Upvotes: 3
Reputation: 31071
The <pre> tag sounds like what you need.