Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<pre> tag won't show text containing <iframe>

Tags:

html

iframe

pre

Why can't I show my <iframe> code line inside a <pre>? I need to show this <iframe> code on a page for people to copy/paste. When I write it within a <pre> tag, it just renders the actual iframe object, rather than outputting the iframe code as text on the page.

<pre>
    <iframe height="150" width="150" src="http://lorem.com/text.html"></iframe>
</pre>
like image 778
designer-trying-coding Avatar asked Oct 21 '11 09:10

designer-trying-coding


People also ask

How do I show text in an iframe?

If it is a static HTML site, create a new page with the content which you want to show and set the src of the <iframe> . If it is a dynamic page app (server side), create a new page or handler or controller (whatever applies) and set the src of the <iframe> .

How do I wrap text in a pre tag?

HTML <pre> tag defines preformatted text. It is used to display code blocks since it preserves spaces and line breaks. If the line is large, then the <pre> tag won't wrap it by default. To wrap it, we need to use CSS.


1 Answers

You need to replace < and > with the respective entities &lt; and &gt;.

like image 86
Till Helge Avatar answered Oct 17 '22 00:10

Till Helge