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

后端 未结 6 1431
死守一世寂寞
死守一世寂寞 2020-12-16 10:49

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

6条回答
  •  天命终不由人
    2020-12-16 11:40

    Because /* */ is the style that is defined for comments in CSS.

    There are a lot of other ways to write comments in other environments that doesn't work in CSS, like:

    //

    --

    '

    REM

    { }

    ;

    #

提交回复
热议问题