Commenting your code

You already learned how to comment HTML.  CSS commenting uses different symbols to mark the beginning and end of a comment but has the same basic purpose.  It allows you to make notes to yourself and other developers.

Open boxes.css in your editor and save it as comments.css.  Paste this just before the div rule set:

/* this causes the box to have a border, a colour and a size */

Save and try the page (boxes.html) and it should be unchanged.  Comments are ignored by the browser.  Add this one to the end of the border-style line:

/* other options include solid, dotted and sunken */

and this one on the end of the width rule:

/* Fred thinks this should be a little bigger so maybe try that later */

Now place the comment markers around the border-color:yellow line in the next rule set so that it looks like this:

/* border-color:yellow; */

Save and reload in the browser and the yellow border will not be applied.  You can comment out code and it is as if it was deleted.  However, it is still there if you want to un-comment it and bring it back.

Start using comments to explain your CSS code from now on.