![]() |
The Definition and UsageThe Text in a Also look at:
Browser SupportGlobal AttributesThe Event AttributesThe |
Example:
HTML
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
See the Example and Learn More.
Example:
HTML
<h2>Standard pre</h2>
<pre>This is a standard pre. It will use as much space as it needs.</pre>
<h2>Fixed width pre</h2>
<div style="width:200px;overflow:auto">
<pre>This is a pre with a fixed width. It will use as much space as specified.</pre>
</div>
Most browsers will display the <pre>
element with the following default values.
Example:
HTML
<style>
pre {
display: block;
font-family: monospace;
white-space: pre;
margin: 1em 0;
}
</style>
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
html pre |
How to add HTML <pre> Tag | HTML Tag |
How to create a pre-formatted text with a fixed width (with CSS) | HTML Tag |
How to set Default CSS Settings on HTML pre Tag | HTML Tag |
Read Full: | HTML Tag |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |
Views: | 228 |
Reffered: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre