HTML · Text and inline semantics
pre
Preformatted text that preserves spaces and line breaks. Ideal for ASCII art, terminal output and code without markup.
Syntax
<pre>…</pre>Example
Try it
Notes
For source code prefer pre with a nested code element.
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.