Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Showing HTML code in a web page

    How do I display actual HTML code in a web page without it being interpreted by the browser? Kind of like using the code tags here.
    Scott Stewart
    Always happy to learn from pros.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Here the forum takes the code posted and changes all < and > to &lt; and &gt; respectively.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,636
    Thanks
    6
    Thanked 1,003 Times in 976 Posts
    Also, to correctly mark up code you would use the <code></code> element, maybe in conjunction with <pre></pre> for preformatted text (that’s what the code tags here do as well) like so:
    Code:
    <pre>
      <code>
        (put code to display here)
      </code>
    </pre>
    Actual HTML in between those tags still gets parsed as HTML.

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Thanks for the fast response! Both of you.
    Scott Stewart
    Always happy to learn from pros.


  •  

    Posting Permissions

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