<pre>
Text that keeps all spaces and line breaks.
Syntax
<pre>preformatted text</pre>Examples
A code block with indentation:
<pre><code>function greet(name) {
return "Hello, " + name;
}</code></pre>Text art:
<pre>
/\_/\
( o.o )
> ^ <
</pre>Notes
Long lines inside <pre> do not wrap and may stick out of the box; add overflow: auto or white-space: pre-wrap. A line break right after the opening tag is ignored by the browser.
See also
In the tutorial
- Text formatting — Inline tags for text — strong and em, mark, del and ins, sub and sup, code, kbd and pre, abbr and q.