Search code examples
csscomments

Why do /**/ comments work in stylesheets, but // comments don't?


Is there a good reason for this? It is a lame question, but I just wondered if there was a reason why.


Solution

  • The syntax for comments in CSS is: /* comment here */

    The // is not a valid syntax. I guess this allows CSS to work correctly when stripped from whitespace and new line characters during minification.