How to write comments in HTML?

How to write comments in HTML?

Asked on October 30, 2018 in HTML / CSS.
Add Comment

  • 1 Answer(s)

    Use the Syntax “<!– text –>”     

    For explaining the markup, comments are used in HTML
    It will help to understand the document quickly and easily at the time of editing the source code.

    Comments are not displayed by the browsers.

    An HTML comment begins with <!–, and ends with –>.

    See the Instance below:

    <!DOCTYPE html>
    <html lang="en">
        <meta charset="UTF-8">
        <title>Comments in HTML</title>
        <!-- This is a single line HTML comment -->
        <!-- This is an example of a
            HTML multi-line comment -->
        <h1>This is a heading</h1>
        <p>This is a paragraph.</p>
    Answered on October 30, 2018.
    Add Comment

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.