Skip to main content

Adding Comments to your Style Sheet

Style sheets can become very lengthy so it is important to annotate the style sheet to show the various sections or modification history. Commenting out sections of a style sheet can be very useful when you are experimenting with various effects.

To add a comment to a style sheet we use the following tags:

/*
Should appear at the beginning of any comment
*/
Should appear after the comment.

For example:

...
/* The following will affect hypertext links */
a {text-decoration:none;}
a:link {color:red; font-weight: bold;}
a:visited {color:blue; font-weight: bold;}
a:active {color:white; font-weight: bold;}
a:hover {color:black; font-weight: bold;}
...