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????????
Use the <PRE> </PRE> element, or just change all of the < and > to &lt; and &gt;.
[J]ona
You will have to use the second suggestion.... <pre><b>test</b></pre> will equal test
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
It would seem like CDATA (http://www.w3.org/TR/REC-xml#sec-cdata-sect) might be it, though I'm not sure.
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
Yes, CODE (http://www.w3.org/TR/html4/struct/text.html#edef-CODE) is the tag you should use, instead of XMP.
[J]ona
Except for the fact that <code> doesn't work any better than <pre>
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?
Originally posted by stancreator
can't you just slap it in a text area?
Yes, but I'd just use &lt; and &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