Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS comments cause weird effects

Tags:

comments

css

Can anyone explain why using comments like this in css cause really weird effects SOMETIMES?


This works fine

/*  ------------------------------  */
/*  some text here                  */
/*  ------------------------------  */

This appear to work fine too until I reload a page and then the page is all messed up in firefox and in chrome if I use any comments like this in css

<!-- sometext here -->
like image 899
JasonDavis Avatar asked Jun 05 '26 21:06

JasonDavis


2 Answers

For CSS files.

<!-- -->

Is not a comment syntax.

like image 153
Ólafur Waage Avatar answered Jun 07 '26 13:06

Ólafur Waage


Why are you using XML-like comment blocks in CSS? Your first form (/* comment */) is the only one supported in CSS.

like image 35
Michael Petrotta Avatar answered Jun 07 '26 11:06

Michael Petrotta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!