How to add comment in CSS
🗓️ Updated: 17.08.2022
💬Comments:
0
👁️Views: 4760
How to properly add comment to code in CSS. Suppose you want to temporarily disable some styles, but do not want to delete the code. To do this, you can use a special code for commenting:
/* h1 {
color: red;
font-size: 32px;
} */
Or another example:
h1 {
/* color: red;
font-size: 32px; */
text-align: center;
}
So we can comment the code with the opening symbols /* and closing symbols */.
And you can comment not only the code, but any text. For example:
/* Headings */
h1 {
color: red;
font-size: 32px;
text-align: center; /* align to the center of the block */
}