Skip to content
Related Articles

Related Articles

CSS | Comments
  • Last Updated : 08 Jun, 2020

Comments are the statements in your code that are ignored by the compiler and are not executed. Comments are used to explain the code. They make the program more readable and understandable.

Syntax:

/* content */

Comment can be single line or multi-line.

Note: The outputs are the same because comments are ignored by the browser and are not interpreted.

Example 1: This example describes the single line comment.






<!DOCTYPE html>
<html>
  
<head>
    <style>
        h1 {
            color: green;
        }
        /* Single line comment */
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <p>
        A Computer Science 
        portal for geeks
    </p>
</body>
  
</html>

Output:

Example 2: This example describes the multi-line comment.




<!DOCTYPE html>
<html>
  
<head>
    <style>
        h1 {
            color: green;
        }
  
        /* This is a multiline
           comment */
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <p>
        A Computer Science 
        portal for geeks
    </p>
</body>
  
</html>

Output:

Supported Browsers: The browsers supported by CSS | Comments are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :