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.
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>
.