Preformatted Text

Estimated reading: 1 minute 52 views

The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.

<pre>
 My Bonnie lies over the ocean.
 My Bonnie lies over the sea.
 My Bonnie lies over the ocean.
 Oh, bring back my Bonnie to me.
</pre>

This will be shown correctly with line breaks preserved.

Share this Doc

Preformatted Text

Or copy link