Click to See Complete Forum and Search --> : showing html code on web site


r1012
07-10-2003, 04:04 PM
i have tried several ways to post html code onto my web page so people can read the code. Everything I try or have been told to use does nothing and when I load the page to the web site the html code is not shown anywhere????????

Jona
07-10-2003, 05:20 PM
Use the <PRE> </PRE> element, or just change all of the < and > to &amplt; and &amp;gt;.

[J]ona

pyro
07-10-2003, 05:24 PM
You will have to use the second suggestion.... <pre><b>test</b></pre> will equal test

Jona
07-10-2003, 06:59 PM
Ah yes, that's right. Although, <XMP> is deprecated, it allows you to use HTML code in it. Pyro, do you know what the HTML 4.01 recommendation to replace XMP is?

[J]ona

pyro
07-10-2003, 07:12 PM
It would seem like CDATA (http://www.w3.org/TR/REC-xml#sec-cdata-sect) might be it, though I'm not sure.

Jona
07-10-2003, 07:14 PM
Originally posted by pyro
It would seem like CDATA (http://www.w3.org/TR/REC-xml#sec-cdata-sect) might be it, though I'm not sure.

No, I don't believe so. That is for XML character data sets. Perhaps <code>? Hmm... I'll look into it.

[J]ona

Jona
07-10-2003, 07:18 PM
Yes, CODE (http://www.w3.org/TR/html4/struct/text.html#edef-CODE) is the tag you should use, instead of XMP.

[J]ona

pyro
07-10-2003, 07:22 PM
Except for the fact that <code> doesn't work any better than <pre>

Jona
07-10-2003, 07:23 PM
Originally posted by pyro
Except for the fact that <code> doesn't work any better than <pre>

Ack! You're right! OK, forget it. Just use the second suggestion I originally posted. lol :p

[J]ona

stancreator
07-12-2003, 05:52 AM
can't you just slap it in a text area?

Jona
07-12-2003, 12:22 PM
Originally posted by stancreator
can't you just slap it in a text area?

Yes, but I'd just use &amp;lt; and &amp;gt; for < and > instead--since, it gives you the ability to put it anywhere on your page, and however you want. You can't change color of certain parts of text in a <TEXTAREA>.

[J]ona