What is the comment format of html

藏色散人
Release: 2023-01-06 11:12:51
Original
13687 people have browsed it

The comment format of

html is "<!-Comment content->". This format has an exclamation mark in the start tag but not in the end tag; and the comment will not be displayed in the browser. Yes, but it can help record HTML documents.

What is the comment format of html

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer

html Comment tag format

Syntax format:<!-Comment content->

Comment: There is an exclamation point in the opening tag, but not in the closing tag. The browser won't display comments, but they can help document your HTML document.

Note: The html comment tag does not support any standard attributes and events!

  • Single-line comments

<h1>html 注释标签的详细介绍</h1><!-- 文章标题-->
Copy after login

Instructions: You can tell from the comments that the title of the article is in front of it.

  • Multi-line comments

<!--
<p>这是文章的一个段落</p>
<p>这是文章的一个段落</p>
-->
Copy after login

Note: When there are bugs in the code, you can use comment tags to troubleshoot!

  • Conditional comments

<script type="text/javascript">
<!--
这是一段JavaScript代码
//-->
</script>
Copy after login

Explanation: Such conditional comments can prevent some browsers from not supporting JavaScript from displaying JavaScript code text in On the page, it affects the beauty!

Recommended study: "HTML Video Tutorial"

The above is the detailed content of What is the comment format of 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