<pre>标签不会显示包含<iframe>的文字

des*_*ing 4 html iframe pre

为什么我不能<iframe>在里面显示我的代码行<pre>?我需要<iframe>在页面上显示此代码,供人们复制/粘贴.当我在<pre>标签中写入它时,它只是呈现实际iframe对象,而不是将iframe代码作为文本输出到页面上.

<pre>
    <iframe height="150" width="150" src="http://lorem.com/text.html"></iframe>
</pre>
Run Code Online (Sandbox Code Playgroud)

Til*_*lge 10

你需要更换<,并>与各实体&lt;&gt;.