HTML pre tag
HTML <pre> tag prints the original text i.e. it preserves the spaces and the format of text. For instance, a poem or a coding sample.
<p>
The text that we
write inside pre element
preserves the text formatting
including spaces.
</p>
<pre>
The text that we
write inside pre element
preserves the text formatting
including spaces.
</pre>
</>
The text that we write inside pre element preserves the text formatting including spaces.
The text that we write inside pre element preserves the text formatting including spaces.
Tag Uses
Specific uses of <pre> tagTag omission
Both opening and closing tags are necessary for the pre element.
Global Attributes
All the global attributes are applicable on the pre element.
Next Previous
Was this article helpful?