CSS Comments Comments are used to explain the code, and may help when you edit the source code at a later date. Comments are ignored by browsers. A CSS comment is placed inside the element, and starts with /* and ends with */:</p> <h2> <strong>Example</strong> </h2> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre>/* This is a single-line comment */ p { color: red; } </pre><div class="contentsignin">Copy after login</div></div> <p>You can add comments wherever you want in the code:</p> <h2> <strong>Example</strong> </h2> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre>p { color: red; /* Set text color to red */ } </pre><div class="contentsignin">Copy after login</div></div> <p>Even in the middle of a code line:</p> <h2> <strong>Example</strong> </h2> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre>p { color: /*red*/blue; } </pre><div class="contentsignin">Copy after login</div></div> <p>Comments can also span multiple lines: </p> <h2> <strong>Example</strong> </h2> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre>/* This is a multi-line comment */ p { color: red; } </pre><div class="contentsignin">Copy after login</div></div> <h2> <strong>Difference between HTML comments and CSS comments</strong> </h2> <p>In HTML, all comments are technically multi-line. <br> In CSS, single-line comments start with // and end at the end of the line, while multi-line comments start with /* and end with */<br> CSS comments work similarly to HTML comments. <br> The difference between them is that CSS comments are designated with the symbols /* ... */, whereas HTML comments are enclosed in <!</p> <h2> <strong>How we add comments in CSS</strong> </h2> <p>In CSS, we can add comments to explain or organize different sections of your stylesheet. Doing so might seem like an extraneous step in the coding process, but comments can be extremely helpful when debugging or redesigning your website.</p>