Video:How to Use Comment CSS
with Dimitri LaBargeCoding can be a mess. Fortunately, you can alleviate this issue by adding simple comment tags in your CSS. This video shows how to use Comment CSS to clarify your programming intentions.See Transcript
Transcript:How to Use Comment CSS
Hi, this is Dimitri LaBarge for About.com, and today we're going to talk about how to use Comment CSS.
Comment CSS Helps Make Coding Easier
Coding can be a mess. You can have hundreds of lines of code, defining dozens of different elements, connecting to a CSS style sheet somewhere else. What to do? Fortunately, this is one of the very simplest issues to solve. In your Cascading Style Sheets, you can add a simple comment tag to clarify your programming intentions. Let's show you how to do this step-by-step.
Starting a Comment Section in CSS
First, you'll start by typing a slash, followed by an asterisk. It looks like this: /* Simple, right? This opens up the comments section. Everything in here--text, code, whatever--is now part of the comment.
Type some text now, just for example: "This is a comment that I am making!" Now, you need to close up that comments field, or the entire page will wind up being one long comment. Type an asterisk, and then a slash (the reverse of the command that opened up the comment). It looks like this: */
Comment CSS Keeps Code in "Storage"
Now you have a very clear indication of what you were trying to do. If someone comes along later and needs to update your code, they're not going to need to play detective. They can refer to your comments, which hopefully, you've left a lot of.
Comments are a great place to store code that you can't bear deleting, but don't have a place in your CSS. Also, they're fantastic for miscellaneous uses like stating authorship, versions and more.
Thanks for watching. To learn more, visit us on the web at About.com.
