Sitemap

How to Include Comments in CSS

1 min readApr 22, 2021

--

Comments in CSS are generally used to explain the purpose of style CSS properties are declared.

Originally published at: How to Write Comments in CSS — PHPCODER.TECH

Purpose of the Write Comments in CSS

Comments in CSS are useful for remote persons to understand the purpose of the code.

Get Bikash Panda’s stories in your inbox

Join Medium for free to get updates from this writer.

Comments are not displayed on the browser. CSS Comments are start with /* and ends with */ . Now you can see all the examples and types on CSS comments.

Types of Comments in CSS

There are two types CSS comments,

  1. Single line Comment.
  2. Multi line Comment.

Single Line Comment in CSS

Here, you can see how we declare single-line comments are,

<style>

/* This is a single line CSS comment */

body {

font-family: Arial, sans-serif;

}

</style>

Multi Line Comments in CSS

Here, you can see how we write multi line comments are,

<style>

/* This is an example of a

multi-line comment in CSS */

body {

font-family: Arial, sans-serif;

}

</style>

Here is the complete reference about how to Write Comments in CSS.

Happy Coding..!

--

--

Bikash Panda
Bikash Panda

Written by Bikash Panda

I am a web application developer. FB Community: @mrpandatech, Twitter: @phpcodertech My PHP problem-solving site http://phpcoder.tech