SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there, I am looking for a way to display some html code on a web page. Obviously if I just type it in, the browser will not display the code. I know there is a way of doing it but cannot work out how.

    Any help would be appreciated.

    Thanks.

  2. #2
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I presume you're typing the code, right? If you use a WYSIWYG program, you don't have this problem. An example of such a program is the free Composer that's included with Netscape Communicatior. As far as I know, this is the easiest way to accomplish showing HTML code on a web page.

    ------------------
    Webmaster
    www.emudreams.web.com

  3. #3
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Surround the code with <code></code>, <xmp></xmp> or <pre></pre> tags. This will make it so the browser displays it as code. <pre> will get you the worst results because IE will format tags inside a <PRE>.

    Your other option is to use character encoding for the brackets. Use an & immediately followed (no space) by lt; for < and gt; for >.

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •