How to create hidden comments in HTML?

WBOY
Release: 2023-08-31 15:05:06
forward
1435 people have browsed it

How to create hidden comments in HTML?

Comments are used to hide content.

To create hidden comments in HTML, we add tag and end it with -- >. Whatever comes inside this tag it is hidden. These comments allow us to easily understand the code.

Comments can be viewed as comments to yourself, and can also allow others to understand the code, while hiding the HTML code so that the browser will not display it on the web page.

grammar

The following is the syntax for hiding comments in HTML.

<!—The text to be commented -->
Copy after login
The Chinese translation of

Example

is:

Example

The following is a sample program to hide comments in HTML.

<!DOCTYPE html>
<html>
<body>
   <!-- The text here is a commented and it is hidden on the web page -->
   <p>DLF stands for Delhi Land and Finance</p>
</body>
</html>
Copy after login
The Chinese translation of

Example

is:

Example

Following is another example program to hide comments in HTML.

<!DOCTYPE html>
<html>
<body>
   <!-- <ul>
      <li> 1 </li>
      <li> 2 </li>
      <li> 3 </li>
   </ul> -->
   <p>Delhi is the capital of India</p>
</body>
</html>
Copy after login

We use inline comment tag inside the

tag. To hide the content of the paragraph.

The Chinese translation of

Example

is:

Example

The following is a sample program to hide comments in HTML, using inline comment tags.

<!DOCTYPE html>
<html>
<body>
   <!-- The text here is a commente and it is hidden on the web page -->
   <p>DLF stands for Delhi Land and Finance<!--FinanceDelhi Land and Finance is one of the largest commercial real estate developer in India.--></p>
</body>
</html>
Copy after login

The above is the detailed content of How to create hidden comments in HTML?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!