Comments

  • Revision slug: CSS/Comments
  • Revision title: Comments
  • Revision id: 50649
  • Created:
  • Creator: McGurk
  • Is current revision? No
  • Comment Added page; page created, 86 words added

Revision Content

{{ CSSRef() }}

Summary

Comments are used to add little notes or prevent the browser from interpreting bits of the CSS.

Syntax

/* Comment */

Examples

/* A single line comment */

/*
A comment
which stretches
over several
lines
*/

Notes

The /* */ comment syntax is used for both single and multi line comments. There is no other way to specify comments in external stylesheets. However, when using the <style> element, you may use <!-- --> to hide CSS from older browsers, although this is not recommended.

Specifications

Revision Source

<p>{{ CSSRef() }}</p>
<h3>Summary</h3>
<p>Comments are used to add little notes or prevent the browser from interpreting bits of the CSS.</p>
<h3>Syntax</h3>
<pre class="eval">/* Comment */</pre>
<h3>Examples</h3>
<pre class="eval">/* A single line comment */

/*
A comment
which stretches
over several
lines
*/<strong><br></strong></pre>
<h3>Notes</h3>
<p>The <code>/* */</code> comment syntax is used for both single and multi line comments. There is no other way to specify comments in external stylesheets. However, when using the <code>&lt;style&gt;</code> element, you may use <code>&lt;!-- --&gt;</code> to hide CSS from older browsers, although this is not recommended.</p>
<h3>Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/CSS21/syndata.html#comments">CSS 2.1 Syntax and basic data types #comments</a></li>
</ul>
Revert to this revision