HTML4 HTML5
Between the opening <pre> tag and closing </pre> tag, we place preformatted text[cite: 3]. Text is displayed in a fixed-width font, preserving all spaces (including consecutive ones) and line break characters[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Code:
The font belongs to the monospace family (fixed character width),
spaces between words can be increased with extra spaces.
End-of-paragraph character (ENTER) is preserved.</pre>
The browser will interpret this code as follows:
This is a piece of preformatted text. The font belongs to the monospace family (fixed character width), spaces between words can be increased with extra spaces. End-of-paragraph character (ENTER) is preserved.