If /* */ then //? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If /* */ then //?

If /* and */ are used as comment in CSS, does // can be used too?

23rd Apr 2017, 1:55 AM
Douglas Goldbach
Douglas Goldbach - avatar
11 Answers
+ 5
Can. but you must use outside property : ;
23rd Apr 2017, 2:03 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 6
People really disliked my "no"? We are talking about plain css and not sass, and in plain css there is no "//". " Double slash (//...) comments are not supported by CSS (afaik, they're ignored but for a different reason than being a comment)."
23rd Apr 2017, 2:10 AM
Tim G
Tim G - avatar
+ 5
But you shouldn't if you are not working with sass !
23rd Apr 2017, 2:11 AM
Tim G
Tim G - avatar
+ 5
@Douglas. It would also ignore lines with "+-" or "€/". But that doesn't make it a comment! The proper way is to use /**/ and not //.
23rd Apr 2017, 2:15 AM
Tim G
Tim G - avatar
+ 5
@Very hard. No offense fam. But just wanna make sure that they know that only because it works they shouldn't use it.
23rd Apr 2017, 2:26 AM
Tim G
Tim G - avatar
+ 5
@Tim G. Yep They shouldn't use it in css Sometimes // can cause some error
23rd Apr 2017, 2:29 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
No
23rd Apr 2017, 1:57 AM
Tim G
Tim G - avatar
+ 4
But I can....
23rd Apr 2017, 2:10 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
@Tim G. Yeah.....absolutely right. use /**/ is better
23rd Apr 2017, 2:15 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
0
Woah! It really works. Thanks.
23rd Apr 2017, 2:07 AM
Douglas Goldbach
Douglas Goldbach - avatar
0
Same here, I could comment lines with it.
23rd Apr 2017, 2:13 AM
Douglas Goldbach
Douglas Goldbach - avatar