Example

Comments in CSS

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link name="favicon" type="image/x-icon" href="https://skillzam.com/uploads/system/e353194f3b7cd1b75d69c3ab88041985.png" rel="shortcut icon" />
    <title>Comments in CSS</title>

    <style>

        h1 {
            color: blue;  /* color of the h1 heading is set to blue*/  
        }

        /* Below CSS code is commented */

        /* h1 {
            color: red; 
        } */
        

    </style>

</head>
<body>

    <h1>Demo: Comments in CSS</h1>

    <p>The color of the h1 heading above is set to "BLUE", instead of "RED". Because the CSS rule for setting the color to red is commented in <style> Tag.</p>

</body>
</html>

Output

View original