HTML - how to use <pre> tag

The HTML <pre> tag is used to define preformatted text. The text within the <pre> tag is rendered in fixed width font, usually, Courier, and white spaces and line breaks are preserved.

The <pre> tag can be used to display computer code.


The pre tag supports the global and event attributes.


<pre> var i = 10; var k = 20; var ans = i * k; console.log(" value of ans: " + ans); <pre>

Related HTML tags: