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
    New Coder
    Join Date
    Mar 2006
    Posts
    64
    Thanks
    5
    Thanked 0 Times in 0 Posts

    How to display html for tutorial in html?

    Hi

    I am creating a site where I want users to copy and paste HTML code. This is a regular webpage ( www.techavid.com/internetradiomobile.php ) not a forum. I see here http://www.w3schools.com/html/html_elements.asp that they are doing this, but when I add my code the way they have my code is being displayed not as html text but as the actual html design.

    Thanks,
    Chaser

  • #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
    They convert all < to &lt; and all > to &rt; you must do the same if you wish to display your html as text rather than html. Users who copy and paste will receive the correct format they need for html. May want to use a textarea and use the script found here http://www.dynamicdrive.com/dynamici...selectform.htm
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    166
    Thanks
    9
    Thanked 4 Times in 4 Posts
    You can also try enclosing them in <xmp> </xmp>
    However, using <pre></pre> and using the character codes (i.e. &lt; ) is considered better practice.
    Last edited by 194673; 05-20-2007 at 07:45 PM.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You can easily do this by Dreamweaver as

    1) Copy the required code from the 'code view'
    2)Paste it on the 'design view' of the page you wish to display


  •  

    Posting Permissions

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