Home » Web Development » 03 - Basic HTML Tags and Style Sheets
3

Preformatted Text

How to integrate preformatted text into html

Sometimes, a need may arise to insert text as it is into the HTML document. This text may already have indents, tab stops and so on and it may be too time consuming to reformat it using HTML. Any text we put between <pre> (or preformatted text) tags will look identical in terms of line breaks, indents, and spacing in both the HTML document and the browser. The <pre> tag is also useful when we have to beam the output of a legacy program onto the browser and when we want to output sample code.

Pre Tag Markup:

<pre>The Pre Tag Preserves Spaces</pre>

Pre Tag Output:

The      Pre      Tag      Preserves      Spaces

Block Quotes