Pre tag is used for? | Sololearn: Learn to code for FREE!


Pre tag is used for?

9/8/2020 1:14:54 PM

Sonu Kumar Kushwaha

4 Answers

New Answer


If you want everycharacter(spaces,linebreaks , text as you have write in code you should use pre tag. Ex- <pre>this Is Pre</pre> Result:- this Is Pre If you write <p>this Is Pre</p> Result:- this is pre So pre tag preserve you spaces and line break in result as you have done in code.


` The HTML <pre> tag is used for indicating preformatted text. The code tag surrounds the code being marked up. Browsers normally render pre text in a fixed-pitched font, with whitespace in tact, and without word wrap. ` From


Pre tag is used for preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. Also see this link it will help you.


If you want to use whitespace and line breaks in your web page then you can use <pre> tag. It will helps you to write pre-formatted text.