How to write comments in CSS?
Use the Syntax “/* text */”
For explaining the purpose of the style rules declarations, comments in css are used.
It will to understand what you were trying to do with the style rules at the time of editing style sheets.
Comments are not displayed by the browsers.
A CSS comment begins with /*, and ends with */.
For example:
/* This is a single line CSS comment */ /* This is an example of a CSS multi-line comment */ body { font-family: Arial, sans-serif; } p { color: #333; line-height: 1.5; }
With a proper structure, comments make it a breeze to navigate and locate the sections in your page, e.g.
/***************
* UI Elements *
***************/
h1, h2, h3, p {
...
}
table, form, input, textarea {
...
}
/* Custom Radio button hack: use background-image/position on label */
input[type=radio] {
display:none;
}
input[type=radio] + label {
background-image: url(...);
}
input[type=radio]:checked + label {
background-image: url(...);
}
/**********
* Header *
**********/
#site-header {
...
}
#logo {
...
}
/***********
* Sidebar *
***********/