HTML <pre> tag
When writing in HTML, the <pre> tag is a block element used to designate preformatted text. It is useful because the text between <pre> tags has both its spaces and line break preserved in addition to being displayed in a fixed-width font. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.
The <pre> tag is quite useful for displaying organized computer code.
Example of <pre> code
<pre>This is a sentence with some preformatted text.</pre>
This is a sentence with some preformatted text.
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The only attribute unique to the <pre> tag is deprecated, meaning that it may function currently, but is not supported in going forward. In this case, CSS should be used in place of these attributes.
|width||Designates the maximum number of characters per line.|
|All versions||All versions||All versions||All versions||All versions||All versions|