A text line enclosed with <pre> tag should preserve white space and most of the time will pre-format the font (usually Courier).
Generally browsers do following actions
- May leave white space intact;
- May render text with a fixed-pitch font;
- May disable automatic word wrap;
- Must not disable bidirectional text processing.
Syntax:
<pre></pre>
Attributes:
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
Example
HTML preformatted text element:
x
<html>
<head>
<title>HTML tutorial</title>
</head>
<body>
<p>Regular text looks like this</p>
<pre>Preformatted text looks like this</pre>
</body>
</html>
Comments
No comments have been made yet.
Please login to leave a comment. Login now