Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

วิธีเพิ่มความคิดเห็นในบล็อก Style Sheet


คุณอาจต้องเพิ่มความคิดเห็นในบล็อก stylesheet การทำอย่างนี้ง่ายมาก ให้ใส่ความคิดเห็นภายใน /*.....this is a comment in style sheet.....*/

คุณสามารถใช้ /* ....*/ เพื่อ comment หลายบรรทัด คล้ายกับ C และ C++

ตัวอย่างการเพิ่ม comment:

<!DOCTYPE html>
<html>
  <head>
    <style>
      p {
        color: red;
        /* This is a single-line comment */
        text-align: center;
      }
      /* This is a
         multi-line comment */
    </style>
  </head>
  <body>
    <p>Hello World!</p>
  </body>
</html>