CSS
or Cascade Style Sheet
provides comments in order to explain CSS code. The comment out operation simply converts a valid and interpreted CSS code into a comment which does not interpret and applied to the defined HTML web page. The commenting out is used to inactive single or multiple CSS code which can be a test code and temporary CSS code.
Comment Out Single Line
The /*
charcaters are used to set start of the comment and */
characters are used to set end of the comment. Simply all characters between /*
and */
are interpreted as comments and not executed and applied as CSS statement. Single line CSS code can be comment out which makes this CSS line inactive. The following CSS code makes the paragraphs fornt size as 10px.
p {
font-size: 10px;
}
We comment out the font-size
line by using the /*
and */
characters like below.
p {
/* font-size: 10px; */
}
Comment Out Multiple Lines
Multiple or block CSS lines are commented out by using the /*
and */
characters to the similar single line comment out. In the following example we have multiple or block lines of CSS code to set body font-size and color.
body {
font-size: 10px;
color: green;
}
We comment out these multiple lines about font-size and color. This comment out action disables these CSS codes .
body {
/* font-size: 10px;
color: green; */
}