HTML HTML Basics Going Further with HTML HTML Entities and Reserved Characters

What is a <pre></pre> tag?

What is a <pre></pre> tag in other words? When do you use it? Thanks

Tadjiev Codes
Tadjiev Codes
9,354 Points

https://www.w3schools.com/tags/tag_pre.asp It basically has it's own format of showing the paragraph. You can see the exercise in W3Schools)

2 Answers

Sumana Vittal
Sumana Vittal
4,694 Points

The pre tag displays the text embedded within the pre tag as it is written. It is rendered using the monospace font. Suppose you want to display piece of text as it is in the browser, then just place it between pre tag. Hope it helped you understand.

Victor Mercier
MOD
Victor Mercier
Treehouse Moderator 13,885 Points

Hi, here is my understanding of a pre tag : The <pre> is used tag to define preformatted text. Text in a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks. Please mark as best answer if helped you!