HTML Pre Tag
In HTML, the
<pre> tag stands for preformatted text.
It is exactly present on the Web page as present in an HTML file.
The whitespace used inside this tag is displayed as written.
The text is written in between
<pre> tag is displayed in a fixed-width font.
Also, it is a Block-Level Element
It is recommended to use
<pre> tag in case of unusual formatting or if you want to write some piece of computer code.
<pre> Tag Syntax and Usage
<pre> tag requires both opening (start) tag and closing(end) tag.
Required syntax for the same is given below:
<pre> Tag Attributes
<pre> tag supports both global and event attributes and some of the common attributes are given below:
This attribute is used to contains the preferred count of characters a line should have, also known as a non-standard synonym of width.
This attribute is used to contains the preferred count of characters a line should have, this does not have a visual effect.
It is used to indicate the hint that overflow must happen
<pre> Tag Basic Example
Below we have a basic example for clear understanding of <pre> tag:
Default CSS Settings for HTML
margin: 1em 0;
Browser Support for HTML
Following browsers support this attribute:
Google Chrome 1+
Internet Explorer 2+