Mastering Cascading Style Sheet – The Commenting System Within Style Sheets

web design

Sharing is caring!

The world of technology have been around for many years now, and we have been seen many developments happen all through the world.

In a society that thrives, the current technology we enjoy, also thrives, and it helps that nation become a powerful nation.

In today’s article we are going to talk about CSS3, in particularly commenting on your code and adding structural comments, to your style sheets

Commenting on style sheets helps you to figure out, where you are on your style sheet, when you come back to it, seven months later.

When a front-end web developer, writes their style sheets, he/she will know, or have a good idea of how these style sheets have been structured.

The front-end web developer, will also know the problems, encountered with the style sheet, in the time of its development.

The front-end web developers, will also know, why things have been done a certain way, when the style sheet was being developed.

Comments will almost always help, front-end web developers, keep up with their own style sheets, over time

It is a good idea to comment on the code of the style sheet, because the CSS code may have to be handed to another developer, for implementation onto a website.

For example, a Drupal/PHP back-end web developer, would never have to develop their own CSS, because they are focused more on implementing the CSS code onto a website, to make that website functional.

The job of a back-end web developer is to know the inner workings, of every parts of the website; however, he/she does not have to, or shouldn’t have to focus on developing styles sheets of a website, although they are required to do so.

Anyhow back to the fact of the matter, in CSS3 comments allow, front-end web developers to share their style sheet code with each other, because the comments, allow front-end web developers, to follow the code of other front-end web developers.

It is very simple to add comments to CSS code, the start of the CSS code comment is /* and the end is */.

The C programming language uses this type of comments; therefore, this type of comment is known as the C style commenting

Comments can appear anywhere within the code, and they can be single or multi-line, such as: body { font-size: 62.5% /* 1em = 10px */ }

Adding structural comments to your CSS is also important, because it allows, front-end web developers to add a comment blocks, at the top of the style sheet, as the first thing they do; in order to describe, the style sheet, to know what it is for, who created it, the date or version number of the style and how to get in touch with the person who created the style sheet.

Other developers are always able to get a sense for the style sheet, with this type of information available, to them, when they are troubleshooting the code of a different developer.

Also other front-end web developers, get a good overview of the file, they also see if it is current and contact the other original developer of the code, with questions, if they encounter problems, with the code.

The style sheet can be broken down into sensible blocks when commenting is used, and the code would always look as if it was written by professionals.

Thank you, for reading this article!!!