HTML comments, we often need to make some HTML comments next to some codes. There are many benefits to doing so, such as: convenient search, convenient comparison, convenient for other programmers in the project team to understand your code, and convenient for you to understand and modify your own code in the future, etc. HTML comments start with <!-- and end with --> HTML Comment Syntax <!--Comment content--> Example Copy code The code is as follows:<!--Comments here--> <a href="https://www.jb51.net">123WORDPRESS.COM</a> <!--End of link--> Here is a more complete list for you Copy code The code is as follows:1. <!--Comment content--> 2. //Comment content (insert single-line comments in CSS or JavaScript) 3. /*Comment content*/ (insert multiple lines of comments in CSS or JavaScript) JavaScript Comments JavaScript Comment Syntax Copy code The code is as follows://Comment content /* Note content */ CSS Comments As described in the HTML tutorial, comments also play an important role in CSS documents, helping us remember the meaning of CSS, where it is loaded in the HTML document, etc. CSS comments start with /* and end with */ CSS Comment Syntax Copy code The code is as follows:/* Comment content*/ Example /* ----------Beginning of text style---------- */ /* White 12 pixel text*/ .dreamduwhite12px { color:white; font-size:12px; } /* Black 16 pixel text*/ .dreamdublack16px { color:black; font-size:16px; } /* ----------End of text style---------- */ JavaScript Comment Example Use two double slashes to comment a line [code] //document.write("www.jb51.net"); Use slash star to comment code blocks (multi-line) /* var jb51 = "www.jb51.net"; var jb51 = "du"; */ [html] Tip: Too many JavaScript comments will slow down the execution and loading speed of JavaScript, so JavaScript comments should be removed when publishing the website. Tip: You cannot use (/* or */, which may be generated in JavaScript regular expressions) in the comment block (/* ... */). This will cause syntax errors, so I recommend that you use // as the comment code. In this tutorial, // will be used to mark comments. |
<<: jQuery Ajax chatbot implementation case study
>>: Detailed explanation of display modes in CSS tags
Table of contents Dockerfile pom.xml Jenkins Conf...
Table of contents Introduction to Anaconda 1. Dow...
Method 1: Use the SET PASSWORD command MySQL -u r...
1. Dynamic query rules The dynamic query rules ar...
Table of contents Implementation ideas There are ...
Table of contents Preface No.1 A focus No.2 Extra...
stat function and stat command Explanation of [in...
Preface : Today I was asked, "Have you carefu...
Problem Description After installing workstations...
Preface Sorting is a basic function in databases,...
Cocos Creator version: 2.3.4 Demo download: https...
Table of contents 1. Installation 2. Import 3. De...
This article shares the specific code of jQuery t...
Table of contents Overview The history of CPU-bou...
Table of contents 1. Introduction to autofs servi...