Horje
How to create <pre> Element in HTML Paragraphs

The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:


Sample of HTML <pre> Element in HTML Paragraphs

The pre tag preserves both spaces and line breaks:
<pre>
   My Bonnie lies over the ocean.

   My Bonnie lies over the sea.

   My Bonnie lies over the ocean.
   
   Oh, bring back my Bonnie to me.
</pre>

Full Example of HTML <pre> Element in HTML Paragraphs

The pre tag preserves both spaces and line breaks:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<p>The pre tag preserves both spaces and line breaks:</p>

<pre>
   My Bonnie lies over the ocean.

   My Bonnie lies over the sea.

   My Bonnie lies over the ocean.
   
   Oh, bring back my Bonnie to me.
</pre>

</body>
</html>

Output should be:

Full Example of HTML <pre> Element in HTML Paragraphs




Related Articles
What is HTML Paragraphs HTML Paragraphs
How to display HTML Paragraphs HTML Paragraphs
How to create HTML Horizontal Rules HTML Paragraphs
How to create HTML Line Breaks HTML Paragraphs
What is the Poem Problem in HTML Paragraphs HTML Paragraphs
How to create <pre> Element in HTML Paragraphs HTML Paragraphs

Single Articles
Sample of HTML <pre> Element in HTML ParagraphsHTML Paragraphs
Full Example of HTML <pre> Element in HTML ParagraphsHTML Paragraphs

Read Full:
HTML Paragraphs
Category:
Web Tutorial
Sub Category:
HTML Paragraphs
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
2
Ref on:
View



Share on: