2.4 CSS Comments

Similarly to the way in which comments can be added to HTML documents, they can also be added to CSS documents, and for much the same reasons. This is done like this: /*comment goes here*/. Anything between the /* and the */ is ignored by a browser.

This can be a really useful tool for when a stylsheet becomes rather long. I personally use it for grouping my sheets into obvious categories, which makes it much easier to find the relevant section I am wishing to tweak or add to. For example:

/*----------------------Root----------------------*/

body 		{
		font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
		font-size:16px;
		color:#565051;
		text-align :center;	
		}

/*----------------------Header----------------------*/

#header		{
		text-align:left;
		margin-bottom:15px;
		}


#header h1	{
		color: red;
		font: 18px verdana, arial, helvetica, sans-serif;
		}


/*----------------------Content----------------------*/


#content 	{
		display:inline;
		float:left; 
		width:800px;
		}


/*----------------------Footer----------------------*/


#footer		{
		clear:both;
		}


/*----------------------Images--------------------*/


img		{margin:10px;}

Admittedly this is a basic example, but believe me, ordering your stylesheet into logical groups using CSS Comments saves a lot of time and effort when working on a website.