Learn html - html tutorial - pre tag - html examples - html programs
The <pre> tag is representing preformatted text.
The text within this element is displayed in monospace font.
The <pre> tag is displayed with fixed-width font and it reserves both line break and spaces.
<pre> tag is belongs to Palpable content and Flow content.
Syntax for <pre> tag in HTML:
<pre>content</pre>
Differences between HTML 4.01 and HTML 5 for <pre> tag:
HTML 4.0.1
HTML 4 is supports all the attributes of <pre> tag.
HTML 5
HTML 5 is not supports width attribute of <pre> tag.
Sample Coding for <pre> tag in HTML:
Tryit<!DOCTYPE html><html><head><title>Wikitechy pre tag</title></head><body><h3>Wikitechy HTML pre tag.</h3><pre>
The HTML pre element represents preformatted text.
Whitespace inside this element is displayed as typed.
</pre><p>
The HTML pre element represents preformatted text.
Whitespace inside this element is displayed as typed.
</p></body></html>
Code Explanation for <pre> tag in HTML:
The text within the <pre> element will be displayed as a preformatted text.
Output for <pre> tag in HTML:
<pre> tagged text is displayed the preformatted form with line break and spaces.
But the normal text remove unwanted spaces.
Attribute for <pre> tag:
Attribute
Value
HTML 4
HTML 5
Description
width
number
Yes
No
It is used to set the maximum number of a characters per line.
Browser Support for <pre> tag in HTML:
Yes
Yes
Yes
Yes
Yes
Tips and Notes
By using the <pre> element the text is displayed with unusual format or some sort of computer code.
code taghtml pre tag examplehtml pre tag wraphtml pre vs codebootstrap pre taghtml pre tag line breakhtml pre widthbootstrap preblockquote tag in htmlhtml tutorialshtml editorhtml codehtml formhtmltutorialhtml colorhtml color codeshtml tablehtml imghtml5html code for websitehtml and csshtml programshtml websitefree html editorhtml5 tutorialwysiwyg html editorhtml tutorial pdfhtml converterphp tutorialhtml examplehtml tutorialcss tutorialhtml csshtml tagshtml basicscode htmlhtml onlinehtml mailtohtml langhtml tags list