Easy Tutorial
❮ Tag Hr Att Global Hidden ❯

HTML <pre> Tag

Example

Preformatted text:


Browser Support

Most browsers currently support the <pre> tag.


Tag Definition and Usage

The <pre> tag defines preformatted text.

Text enclosed in <pre> tag elements typically preserves spaces and line breaks. The text is also displayed in a fixed-width font.


Tips and Notes

Tip: A common use of the <pre> tag is to represent computer source code.


Differences Between HTML 4.01 and HTML5

In HTML 4.01, the "width" attribute was deprecated and should not be used. HTML5 does not support the "width" attribute.


Attributes

Attribute Value Description
width number HTML5 does not support this attribute. HTML 4.01 deprecated this attribute. Defines the maximum number of characters per line (typically 40, 80, or 132).

Global Attributes

The <pre> tag supports global attributes. View the complete list of HTML Global Attributes.


Event Attributes

The <pre> tag supports all HTML Event Attributes.

❮ Tag Hr Att Global Hidden ❯