<pre> tag won&#39;t show text containing <iframe></iframe></pre>

时间:2011-10-21 09:29:03

标签: html iframe pre

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

<pre>
    <iframe height="150" width="150" src="http://lorem.com/text.html"></iframe>
</pre>

1 个答案:

答案 0 :(得分:10)

您需要将<>替换为相应的实体&lt;&gt;