Monday, August 11, 2008

The <pre> tag

All the text inside a pre element is rendered exactly as it is in the HTML document, ignoring normal HTML whitespace and line wrapping rules. The text is rendered in monospace font. Use this tag when you want the text to appear exactly the way it was entered in the document, or when you want the columns and rows of characters to always lineup in a particular way. Tab stops are defined at every eighth character position but using tabs is unreliable. Therefore, it is better to use spaces to lineup characters.
The pre element can contain any inline elements but not block-level elements. All special characters must be substituted with entity equivalents (example: < , > etc.).

No comments: