What is the <pre> element in HTML?
In HTML, the <pre> element is used to display preformatted text in a fixed-width font, preserving both spaces and line breaks. <pre> displays the text in the exact format on the HTML page.
Syntax
<pre> pre-formatted content </pre>
Example
The following code demonstrates the usage of the <pre> element in HTML.
The content that we want to display as preformatted text is written within the opening and closing tags, <pre> and </pre>.