HTML <pre> tag
The <pre> tag tells the browser to render the text and element in the same way as it is coded by retaining the exact space, font-size, line breaks and other formatting characters etc.
The font face is displayed in courier by default.
Browsers usually render <pre> text into fixed-pitched font. It contains line breaks and spaces.
Syntax:
<pre> Text…</pre>
Example
<pre>The pre tag describes preformatted text in HTML page. including line breaks and spaces</pre>
How Browser will display
INLINE.
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
None | None | The width attribute used with this tag is deprecated in HTML5. |
Attributes used with <pre> tag
NONE
Global Attributes
The <pre> tag supports Global attributes.
Event Attributes
The <pre> tag supports Event attributes.