Note:The CSS comment statement does not display on the screen & it is useful for a screen reader.
Write a single line inside /*
and */
to make a single-line comment.
p { color: red; /* Set text color to red */ }
p{ color: red; /* Set text color to red */ }
Note:The CSS single line comment statement is written inside / *
Your CSS Comment Statement */
statement.
Write more than one line inside /*
and */
to make multi-line comments.
General sysntax for writing multi line comment:
/*
This is
a multi-line
comment
*/
/*
This is
a multi-line
comment
*/
Note:Follow the above mention steps to create single and multi-line comments.
<!--
and end with
-->
/*
and end with */
p { color: red; /* This is css comment syntax */ }
<h3>This is HTML commented line</h3>
<!-- This is HTML Comment synatx -->
p{ color: red; /* This is CSS comment syntax. font-size:1.2rem; */ }
<!-- <h2>This is HTML Comment syntax</h2> -->
<h3>This is HTML commented line</h3>
Note:Please keep in mind that HTML and CSS comments are useful for screen readers as well as other developers.