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
1. InnoDB storage engine must be used It has bett...
MySQL filtering timing of where conditions and ha...
Due to the company's business requirements, t...
Preface Creating shortcuts in Linux can open appl...
1. What is deadlock? The official definition is a...
Sometimes, we don't want the content presente...
This article mainly describes how to implement fo...
There are two ways to create a primary key: creat...
Table of contents background Achieve a similar ef...
Deploy redis in docker First install Docker in Li...
1. Download the image docker pull selenium/hub do...
Simple application deployment 1. Directory struct...
Google's goal with Flutter has always been to...
This article example shares the specific code for...
hint This plug-in can only be accessed under the ...