CSS 注释通常用于解释您的代码。这对阅读您代码的用户非常有帮助,以便他们可以轻松理解代码。
浏览器会忽略注释。
注释是单行或多行语句,写在 /*................*/ 内。
<!DOCTYPE html> <html> <head> <style> p { color: blue; /* This is a single-line comment */ text-align: center; } /* This is a multi-line comment */ </style> </head> <body> <p>你好Rocschool.com </p> <p>这个语句是用 CSS 样式化的。</p> <p>CSS 注释被浏览器忽略,不会显示在输出中。</p> </body> </html>