Css comments

I know that to comment out css you use /* code code code /
but i noticed that sometime you find a php // and it seems to nulify the css code as well. at least for that one line.
would there be issues if the coder uses // instead that the /
*/ ?
it seems it stills works.


CSS comments are as you stated /* stuff here ignored as far as css is concerned */. They are the only comments you should use.

What I think you are experiencing is something like this:


The rule above will not work because CSS is looking for a selector called “// div {}” and none exists. All you have done is describe a non existent element so nothing gets matched. The rule following that would match though.

It’s the same problem you get when someone duplicates a bracket in error.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
div { 
p { background:green }


The CSS looks for a selector called “} p” and none exists so it moves on. Sometimes in Firefox this can stop any following rules working.

That’s why its important to validate the code and check for erroneous errors.