CSS Comments

Used to add explanatory or informational notes within your stylesheet that are ignored by the browser when rendering the web page.
Comments are helpful for providing context to your code or for temporarily disabling certain styles without removing them entirely.
There are two types of comments:
  1. Single-line comments
  2. Multi-line comments

Single-line comments

Example

/* Single line */

Multi-line comments

Example

/*
  Add this style for better size and margin of your text.
  .content {
    font-size: 16px;
    margin: 20px;
  }
*/

Example

/* Reset default margins and padding */
body {
  margin: 0;
  padding: 0;
}

/* Header styles */
.header {
  background-color: #333;
  color: #fff;
}

/*
  Add this style for better size and margin of your text.
  .content {
    font-size: 16px;
    margin: 20px;
  }
*/

/* Footer styles */
.footer {
  background-color: #555;
  color: #fff;
}

Quick Recap

Topics Covered

CSS Comments

Practice With Examples in Compilers

The Concepts and codes you leart practice in Compilers till you are confident of doing on your own. A Various methods of examples, concepts, codes availble in our websites. Don't know where to start Down some code examples are given for this page topic use the code and compile or Try on own Now

Example 1

Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK

Rating


Message