I have seen Commented CSS in my PHP page enclosed within <!-- -->
like
<style type="text/css">
<!--
body { }
...
-->
</style>
when I was optimizing my code then I deleted those commented CSS code from my page,
but after deleting, layout of that page has been disturbed.
when I again paste those commented CSS , it was working fine??
please tell me the reason and how does it possible that CSS is applying despite of comments
Because you’re using the wrong comments syntax, you should be using:
/* ... */to comment out CSS, the<!-- ... -->is html comment syntax; and once you’re inside of thestyleelement html is itself invalid and can, therefore, be handled by the browser as it sees fit.Therefore you may want to try:
It’s worth noting that, like html, there is no single-line comment syntax, which in JavaScript for example would be anything following
//.Some further information: CSS – smarter code comments