: The PRE Element
Last updated: 2026-09-12
<pre>The PRE Element
Preformatted text preserving spaces and line breaks in a monospace font; ideal for code or poetry.
| Category | Text Content |
|---|---|
| Content Model | Flow content |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Yes — requires closing </pre> tag |
| Status | Standard |
📝 Syntax
<pre>preserves
indentation and
line breaks</pre>
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <pre> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: Whitespace inside pre is shown as-is—avoid extra indentation; often paired with code.
🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.