为什么我不能显示我的 <iframe>
<pre>
中的代码行?我需要展示这个 <iframe>
页面上的代码供人们复制/粘贴。当我把它写在 <pre>
中时标签,它只呈现实际的 iframe
对象,而不是输出 iframe
代码作为页面上的文本。
<pre>
<iframe height="150" width="150" src="http://lorem.com/text.html"></iframe>
</pre>
最佳答案
您需要替换 <
和 >
与各自的实体 <
和 >
.
关于html - <pre> 标签不会显示包含 <iframe> 的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7847465/