This <pre> element renders a block of text in a fixed-width or monospaced font.
<pre> |
Yes | Yes | Yes | Yes | Yes |
The "width" attribute is deprecated in HTML5.
Attribute | Value | Description |
---|---|---|
width | number | Not supported in HTML5. Set the maximum number of characters per line |
The <pre> tag supports the Global Attributes in HTML.
The <pre> tag supports the Event Attributes in HTML.
pre { display: block; font-family: monospace; white-space: pre; margin: 1em 0; }
A demo showing how to use <pre> tag.
<html>
<body>
<pre>No nonbreaking spaces (&nbsp;)
are necessary in a pre element.</pre>
</body>
</html>