CSS Comment
Note:The CSS comment statement does not display on the screen & it is useful for a screen reader.
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.
General Syntax
p { color: red; /* Set text color to red */ }
Source Code
p{ color: red; /* Set text color to red */ }
Code Explanation
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:
General Syntax
/*
This is
a multi-line
comment
*/
Source Code
/*
This is
a multi-line
comment
*/
Code Explanation
Note:Follow the above mention steps to create single and multi-line comments.
<!--
and end with
-->
/*
and end with */
General Syntax
p { color: red; /* This is css comment syntax */ }
<h3>This is HTML commented line</h3>
<!-- This is HTML Comment synatx -->
Source Code
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>
Code Explanation
Note:Please keep in mind that HTML and CSS comments are useful for screen readers as well as other developers.