<pre> : Preformatted Text element

Introdution

The <pre> element in HTML is used to define preformatted text. This element preserves both spaces and line breaks in the text, displaying it exactly as it appears in the HTML code. It’s typically used for displaying code snippets or any text where formatting is important

For example:

Output :

In the above example, the text will be displayed exactly as it appears between the <pre> and </pre> tags, with multiple spaces preserved and displayed as they are.

Leave a Comment