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

How to comment in html

藏色散人
Release: 2019-11-25 10:38:56
Original
14097 people have browsed it

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 .

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>
Copy after login

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!

Related labels:
source:php.cn
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