Q:

How to write comments in HTML

0

How to write comments in HTML

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Use the Syntax "<!-- text -->"

Comments in HTML are typically used to explain the markup. It will help you and others to select or find the specific section in the document quickly and easily at the time of editing the source code. Comments are simply ignored, they are not displayed by the browsers.

An HTML comment begins with <!--, and ends with -->. Here's an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Comments in HTML</title>
</head>
<body>  
    <!-- 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>
</body>
</html>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now