Horje
How to create <pre> Element in HTML Paragraphs | HTML Paragraphs Code
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



Read Full::
HTML Paragraphs Code
Category:
HTML Code
Sub Category:
HTML Paragraphs Code
Uploaded:
8 months ago
Uploaded by:
Admin
Views:
1

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

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

Share on: