Welcome to WebmasterWorld Guest from 54.226.189.112

Forum Moderators: incrediBILL

Message Too Old, No Replies

How to show html code on a web page

need to show an example of code

     

Deep_Woods

6:45 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



I have cms set up on a website for the owner to post images and text. I am building a help page to show him how to insert images via html. I need to show an example of the actual code of an image. How can I do this?

hexdj

7:11 pm on Aug 8, 2005 (gmt 0)

5+ Year Member



Just wrap whatever HTML code u want him to read inside a <pre> tag (it can be any tag you want) that way he will see it as regular readable text and the browser won't process that code.

Deep_Woods

8:35 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



It will work like that but it won't let me add the < and > to the html code...when I add the brackets it shows an image placemat.

?

hexdj

8:45 pm on Aug 8, 2005 (gmt 0)

5+ Year Member



to insert a "<" you will have to type in: &lt;

and for ">" type &gt; in YOUR html code

that should do the trick, the ampersand and the semi-colon are both required

aaronpaul

8:46 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



You can replace the "<" and ">" with the ASCII code for those characters.

So, it would look like this:

<pre>
&lt;img src="image.jpg" width="20" height="20" border="0" alt=""&gt;
</pre>

and would look like this when viewed in a browser:
<img src="image.jpg" width="20" height="20" border="0" alt="">

Deep_Woods

8:51 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



Thanks folks...great job!
I knew there was a way to do that but I could not for the life of me remember what it was. ;)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month