Home >Web Front-end >HTML Tutorial >How to comment in html

How to comment in html

藏色散人
藏色散人Original
2019-01-09 16:19:4414131browse

Comments in HTML are often used to explain markup. When editing source code, it will help you and others quickly and easily select or find specific parts of the document. The browser will not display comments.

How to comment in html

HTML comments start with de5460ea25c01a94a6ca012370dd23d4.

The code examples are as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Comments in HTML</title>
</head>
<body>  
    <!-- 这是单行HTML注释 -->
    <!-- 这是一个例子
         HTML多行注释  -->
    <h1>这是标题</h1>
    <p>这是一个段落。</p>
</body>
</html>

In short, HTML comments are codes that are not executed by the program. Used by programmers to mark up code.

When writing HTML code, we often need to make comments next to some key codes. This has many benefits, such as: it is easier to understand, easier to find, or easier for other programmers in the project team to understand your code. , and it will make it easier for you to modify your code in the future.

This article is an introduction to HTML comments. It is very simple and easy to understand. I hope it will be helpful to novices!

The above is the detailed content of How to comment in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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