What is a pre tag




Preserve formatting is a special kind of HTML formatting in which if the text is written then it is displayed in the same format. HTML uses the <pre> tag for this particular format. 


Like other tags in HTML, the <pre> tag also has an opening tag <pre> and a closing </pre> tag. 


Ex:- 

<!DOCTYPE html>

<html>

<head>

<title> HTML pre tag </title>

</head>

<body>

<pre>

Preserve formatting is a


               kind of HTML formatting

</pre>

</body>

</html>


Output : 

Preserve formatting is a


              kind of HTML formatting