Results 1 to 6 of 6

Thread: How to include comments in HTML

  1. #1
    Join Date
    Nov 2009
    Posts
    129

    How to include comments in HTML

    Hello Friends,

    I have one HTML query to ask you. I am aware that how to include the comment in the Java programming and C programming. But HTML comments are new for me, I don't know how to include the comments in the HTML document. The comment should not be displayed while running the HTML page.
    Is anybody knows how to include comments in HTML, then please let me know that.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to include comments in HTML

    Hi,

    Basically HTML is an SGML type of application so it has support to the SGML comments. "<!--" is used to start the HTML comments and "-->" is used to end the HTML comments. Before including any HTML comments make sure that you don't have ">" or "--" within HTML comments. See below example:
    HTML Code:
    <!--
     Type the HTML comment here 
    -->

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: How to include comments in HTML

    The comments are text which doesn't display when you run the program. The syntax for comments in the java programming and in HTML language is quit different . Each and every content included within the <!-- and --> is not considered by web browser. Following is the example of the HTML comments:
    Example:
    <Body>
    <!--
    This is the program for comment testing
    -->
    <Body>

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to include comments in HTML

    Hello,

    Please review the below example which demonstrates the HTML comments:
    HTML Code:
    <Html>
    <Head>
    <Title>Comment Testing</title>
    <Body color="Green">
    <h6> This the HTML program to overview the comment implementation in the Html programming </h6>
    
    <!-- This is only for testing -->
    
    </body>
    </html>

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: How to include comments in HTML

    Following are some different type of comments available in the programming:

    Html Comments:
    • <!-- Put you comment here -->

    Java Comments:
    • // Put you comment here
    • /* Put you comment here*/

    C comments:
    • // Put you comment here
    • /* Put you comment here*/

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to include comments in HTML

    Hi friends,

    HTML has the supports for the multiline comments. And this can be achieved using <!-- and --> tag. When you include any comment in the HTML, then make sure that you are not including it in the < and > tag. For example see below:

    Wrong comment:
    HTML Code:
    < <!-- comment in the HTML --> >
    Correct comment :
    HTML Code:
    <!-- comment in the HTML -->

Similar Threads

  1. How to include .SWF files to the html webpage
    By LynDa55 in forum Technology & Internet
    Replies: 3
    Last Post: 15-01-2011, 07:02 PM
  2. How do I include one file inside another in HTML?
    By Ekavali in forum Software Development
    Replies: 4
    Last Post: 19-08-2010, 01:38 PM
  3. How to include the video file in Html
    By Owen Fernandes in forum Software Development
    Replies: 5
    Last Post: 29-12-2009, 11:40 AM
  4. How to include Header & footer within HTML?
    By seema_thk in forum Software Development
    Replies: 3
    Last Post: 09-12-2009, 09:24 AM
  5. Include a html file by removing head / body
    By KALYAN23 in forum Software Development
    Replies: 3
    Last Post: 09-10-2009, 04:30 PM

Tags for this Thread

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
  •  
Page generated in 1,713,405,478.31083 seconds with 16 queries