We know that when the browser renders and displays the HTML page, it will process the spaces and newlines in the HTML file, so the formatting we originally wrote in the HTML file may not work. The effect, especially when we want to display structured program code, we will encounter problems, as shown below:
<html> <body> for i = 1 to 10 print i next i </body> </html>
Such HTML files will all be printed when displayed on the browser On one line, it looks like this:
for i = 1 to 10 print i next i
In this way, the understanding of the program cannot be clearly seen, so how can it be displayed as written in the HTML file?
The preformatted tag plays its role here. This tag mainly processes spaces and blank lines and retains the spaces and blank lines that exist in the HTML file. . After we add this tag, it looks as follows: </span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false;"><html>
<body>
<pre class="brush:php;toolbar:false">
for i = 1 to 10
print i
next i