CSS Comments


CSS Comments are usually written to explain the code. They are commonly used to mention that which code is used for which purpose. Comments are generally ignored by browsers.

A CSS Comment starts with /* & ends with */ . CSS Comments are written within the <style> tag.


Single Line Comment


This is how a single line comment can be added within the CSS code:


/* This is a single line Comment */
h1 {
  color:blue;  /* The text color of h1 tags to be blue */
}
img {
  width:50%;   /* This is image width */
}

Live Demo!


Multi Line Comment


This is how a multi-line comment will look like:


/* This is a
Multi line
 Comment */
h5 {
  background-color:gray;  /* This is a single line comment */
}

Live Demo!