Comments are annotations in the source code of a program that are ignored by the interpreter. As a result, they have no effect on how the code runs or the output it produces.

But, they can be used to explain what your code is doing to any humans that attempt reading your code. Therefore, they can be incredibly useful to both others and your future self when you try to figure out what the code you wrote 6 months ago does.

In CSS, comments begin with /* and end with */ tags. Anything you put inside those two tags will not be interpreted.

Here's what it looks like:

      /* The CSS Comment */

      element {
        height: 100%;

The comments allow you to add notes about the code without it being interpreted. These can help other people understand your code or remind your future self why you did things a certain way.

Build A Hacker News Clone
Learn how to build and deploy a full-stack, production-ready application with React.js, Node.js, and MongoDB.
View Course

Here's another example with an inline comment:

      element {
        height: 100%; /* The CSS Comment */

Hopefully, this article was helpful.

Thanks for reading and happy coding!