I've noticed that initial comment in javascript or css files is sometimes started with /*! What is the purpose of the explanation mark?
For example, jquery.js:
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
bootstrap.css:
/*! * Bootstrap v2.0.1 * * Copyright 2012 Twitter, Inc
A CSS comment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the style sheet. By design, comments have no effect on the layout of a document.
How to Comment in CSS. To comment in CSS, simply place your plain text inside /* */ marks. This tells the browser that they are notes and should not be rendered on the front end.
Like most languages, CSS allows the users to add comments in the stylesheet. Comments in CSS can be added by using the /* tag, which is then closed off by using */ . Note: Code that is commented out is not used to style the page. This technique can be used to add both single and multi-line comments.
In CSS, a comment always starts with /* and ends with */ . The reason for the special rules for <! -- and --> is that very long ago (and we are talking about the time when Netscape 1 was still in use), some browsers did not recognize the style element at all.
It tells compression tools such as the YUICompressor and Uglify, which minify the code, to leave the commented section in place as they usually remove all comments from the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With