Adding comments to your CSS files can be a huge help to you and others during the development process if used correctly. The most common is to add hint information to CSS style rules, but using comments is also helpful to optimize organizational structure and improve utility.
Tips and tags
This is the most common way to annotate. You can leave tips for yourself or other developers to avoid unnecessary confusion and trouble later. This simplicity of application is paramount. For example:
/* Turn off borders for linked images */
img { border: 0; }
Timestamps and Signatures
Many designers and developers mark the latest updated CSS files with the date and time, as well as their name. These will provide us with some contact information and documentation updates.
/* Styles Updated: Thu 4.8.08 @ 5:15 pm Author: 52CSS.com ——-*/
This method can be very useful for a project, especially if you are part of a team. . Be warned that some organizations require this information to be left in the document, and some companies like to leave names and dates outside the document, so it’s best to clarify these things before you start.
It
's a good idea to use comments to indicate different sections of your CSS document. For example, if all header information is grouped together, you can use comments to distinguish it from the block style below.
/* HEADER ————————————————-*/
I will elaborate further on this next, but now let’s first discuss how to “separate style types”
annotation tags
if your CSS If the files are divided into blocks as I mentioned above, using comment markers can work with the "find" function to allow you to switch between various parts of the document easily. Mark a chapter (Chapter), such as using the equal sign "=", and then add a block name after it, such as "HEADER", thus creating an "anchor" for your CSS document.
/* =HEADER ——————————————————-*/
This method is especially useful in style sheets with complex content.