HTML comments

Discussion in 'HTML & Website Design' started by Nick Heng, Jul 3, 2012.

  1. #1
    can someone tell me what is HTML COMMENTS ?
    什么是 HTML 注释?
     
    Nick Heng, Jul 3, 2012 IP
  2. xXxpert

    xXxpert Well-Known Member

    Messages:
    604
    Likes Received:
    34
    Best Answers:
    9
    Trophy Points:
    165
    Digital Goods:
    7
    #2
    HTML comments are used to add hidden text in your code, that dont show up on your website, but still available in code, mistly comments are used to hide some part of your HTML code, so code will not run but still available to use in future.
    Or we use comments to tell wich part of website working what..

    HTML tags for comments are
    <!-- Your Cooment --> 
    Code (markup):
     
    xXxpert, Jul 4, 2012 IP
  3. Nick Heng

    Nick Heng Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    got it , thx ;)
     
    Last edited: Jul 4, 2012
    Nick Heng, Jul 4, 2012 IP
  4. Alien44

    Alien44 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    Comments are good for dividing you code so that its easier to understand. If you go back to re-code after a long period of time, you'll find it much easier to decipher everything.
     
    Alien44, Jul 4, 2012 IP
  5. zaidi1813

    zaidi1813 Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    How to block HTML in comments that are submit to data base.???????
     
    zaidi1813, Jul 5, 2012 IP
  6. webiconset

    webiconset Greenhorn

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #6
    Commenting your HTML is a really good practice. And you can understand your own code easily later as well.
     
    webiconset, Jul 7, 2012 IP
  7. netcommlabs

    netcommlabs Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Commenting is good for remembering your own script.
     
    netcommlabs, Jul 11, 2012 IP
  8. Unni krishnan

    Unni krishnan Peon

    Messages:
    237
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    0
    #8
    An HTML comment begins with "<!--", ends with "-->" and does not contain "--" or ">" anywhere in the comment.
    Some comment examples :
    
        <!-- I am a HTML Comment -->
        <!---->
        <!>
    
    Code (markup):
     
    Unni krishnan, Jul 11, 2012 IP
  9. businessoftheday

    businessoftheday Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    An HTML comment strated with <!-- not display the commented part -->.In HTML you should use comment tag the commented part of html should not displayed in browser.
     
    businessoftheday, Jul 13, 2012 IP
  10. quotemeremovals

    quotemeremovals Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    <!--This is a comment. Comments are not displayed in the browser-->

    <p>This is a paragraph.</p> This is single line and mutiline comments.
     
    quotemeremovals, Jul 16, 2012 IP
  11. quotemeremovals

    quotemeremovals Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    <!--This is a comment. Comments are not displayed in the browser-->

    <p>This is a paragraph.</p> This is single line and multiline comments.
     
    quotemeremovals, Jul 16, 2012 IP
  12. devjohndevon

    devjohndevon Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #12
    This means that the following are all legal SGML comments:

    <!-- Hello -->
    <!-- Hello -- -- Hello-->
    <!---->
    <!------ Hello -->
    <!>
     
    devjohndevon, Jul 16, 2012 IP
  13. 3dy.ro

    3dy.ro Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    45
    #13
    By asking us an intelligible question. We will be happy to help you as soon as we understand what you mean.
     
    3dy.ro, Jul 16, 2012 IP
  14. wemowe8230

    wemowe8230 Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.
     
    wemowe8230, Jul 18, 2012 IP