How to insert Code within an HTML page

12 replies
Hello Guys,

Forgive me if I have posted this thread in wrong forum, but I need some quick help.

I have a set of HTML Code and I want to show that code on my HTML page to the users. How can I do it?

The tags must also be visible to the users.

Thanks! Your help will be appreciated..
#code #html #insert #page
  • Profile picture of the author Tim3
    Take a screen shot using Windows snipping tool or similar
    Signature

    {{ DiscussionBoard.errors[3707068].message }}
  • Profile picture of the author Dimitris Skiadas
    If i understood your question correctly,if you are using Mozilla Firefox, with Ctrl + U, you have the chance to view the source code-HTML
    {{ DiscussionBoard.errors[3707087].message }}
    • Profile picture of the author fazlerocks
      Originally Posted by Garage667 View Post

      If i understood your question correctly,if you are using Mozilla Firefox, with Ctrl + U, you have the chance to view the source code-HTML
      I am not asking to view the source codes. I have a HTML page up and running. I want to post a tutorial on HTML on that. So I have show my visitors some HTML codes explaining various tags,etc. How can I show that HTML codes to my Visitors. If I am trying to include those into the main HTML page, the example code's tags are removed and only the inner codes are visible.

      Hope I am clear this time..
      {{ DiscussionBoard.errors[3707108].message }}
  • Profile picture of the author joyfulwraps
    Hope this helps...

    If you are looking to show examples of HTML on your web page, you should use the following:

    &lt; = <
    &gt; = >
    {{ DiscussionBoard.errors[3707097].message }}
    • Profile picture of the author fazlerocks
      Originally Posted by joyfulwraps View Post

      Hope this helps...

      If you are looking to show examples of HTML on your web page, you should use the following:

      &lt; = <
      &gt; = >
      Oh Thanks a lot for Help! It is definitely working.

      Isn't there any other alternative through which I can show all of the codes together without having to replace each < with &lt; and > with &gt ??

      Actually, I have a lengthy example code! So it will take a whole lot of time to replace each one of them..
      {{ DiscussionBoard.errors[3707122].message }}
  • Profile picture of the author Istvan Horvath
    Notepad > Edit > Find and Replace?
    (any decent html/code editor MUST have that kind of function... How do you edit PHP code if you don't have an editor??? see your sig)
    Signature

    {{ DiscussionBoard.errors[3707156].message }}
    • Profile picture of the author fazlerocks
      Originally Posted by Istvan Horvath View Post

      Notepad > Edit > Find and Replace?
      (any decent html/code editor MUST have that kind of function... How do you edit PHP code if you don't have an editor??? see your sig)

      I don't use any Editor or third party resources to write my codes. I do all the part myself using notepad. So for any trouble I have to google it down or ask in forums for help.

      This helps programmers to become strong and robust.

      BTW My question was not to find and replace a set of code. Please look above.
      {{ DiscussionBoard.errors[3707171].message }}
  • Profile picture of the author Istvan Horvath
    Even Notepad has that function... how comes you never had to use it? (just wondering, no need to answer)

    EDIT. Using a colour highlighted editor like PSPad, for example, wouldn't take away anything from your programming strength. Wise workers use top quality tools.
    Signature

    {{ DiscussionBoard.errors[3707178].message }}
    • Profile picture of the author fazlerocks
      Originally Posted by Istvan Horvath View Post

      Even Notepad has that function... how comes you never had to use it? (just wondering, no need to answer)

      EDIT. Using a colour highlighted editor like PSPad, for example, wouldn't take away anything from your programming strength. Wise workers use top quality tools.
      That's not my question.
      {{ DiscussionBoard.errors[3707196].message }}
  • Profile picture of the author Istvan Horvath
    1. Use a text area in your page's html and put the code there.
    2. syntaxhighlighter - Free syntax highlighter written in Java Script - Google Project Hosting
    Signature

    {{ DiscussionBoard.errors[3707281].message }}
  • Thanks this helped me out too.
    {{ DiscussionBoard.errors[3707675].message }}

Trending Topics