您可以使用以下代码示例在HTML中使用 <pre>
元素来显示预格式化文本:
<pre>
This is some preformatted text.
It will be displayed in a fixed-width font
and preserve any spacing and line breaks in the text.
</pre>
在上面的示例中,<pre>
元素包含了预格式化的文本,其中的空格、缩进和换行符都将被保留,而不会被浏览器自动处理。预格式化文本通常用于显示代码或计算机输出等需要保留原始格式的内容。