CSS Comments



CSS Comments : Hiding Non-Usable Code

  1. Comments are used to explain code.
  2. Comments are used to hide non-usable code.
  3. Comments are ignored by browser.
  4. Comments are used while debugging the code.
  5. CSS comment begins with “/*“, and ends with “*/

Live Example of CSS Comment :

/*This is a First comment*/
h1
{
text-align : right;
color : /*This is Second comment*/ red;
font-family : arial;
/*This is Third comment*/
}

this CSS code consists of Comments. Comments are ignored by the browser so browser will read block of code in this manner -

h1
{
text-align : right;
color : red;
font-family : arial;
}