<pre> Tag Syntax
Rules for coding HTML pre
elements
<body> ... ... flow content expected ... <pre>... phrasing content ... ... phrasing content ...</pre> ... </body>
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Include a pre element where flow content is expected.
- Begin the pre element with a starting <pre> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any HTML global attributes on the <pre> tag as appropriate.
- End the pre element with a matching
</pre>
closing tag. - Inside the pre element, between the
<pre>
starting tag and the</pre>
ending tag, code the inner HTML phrasing content with the preformatted content, taking care to include new lines and other whitespace only where it is to be displayed in the rendered document. As needed, code any phrase elements such as code element(s) for computer code or samp element(s) for computer output, or other tags that can be used in phrasing content.
Content of the pre element
The content of the b element can include HTML comments, text content and any tags that can be used in phrasing content.