Martin Ernst <m.*****@connect-wa.de> wrote:
I want to show HTML source code in my browser (for debugging
purposes). Which tag/formatting di i have to use to tell the browser
not to render the code but display it as pure text?
If you want the whole page to be seen as code then you can configure
your server to serve it as text/plain rather than text/html. However,
IE will still parse it as HTML; better browsers will display it as
plain text.
I want
<p>Hello World</p>
to be displayed in the browser.
I have tested <code><p>Hello world</p></code>, but that doesn't work.
That tells the browser that the enclosed content is code, which is a
good thing. However, it doesn't tell the browser tos top parsing it
for HTML tags.
You need to convert all the isntances of < to <
In some cases you also need to convert > to > and wether you do so
in all cases is up to you.
<p>Hello World</p>
(You'll also need to convert & to & so that © would be
&copy; and would be displayed as © rather than as teh
copyright symbol.)
There's also the very old, <xmp></xmp> element but that's been
obsolete since HTML 2, isn't supported by all browsers and really can
not be recommended.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>