Anyone can explain to me, why it is important to comment the first line in CSS sheets? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Anyone can explain to me, why it is important to comment the first line in CSS sheets?

2nd Jun 2016, 6:20 AM
Smukeliso
Smukeliso - avatar
9 Answers
+ 1
Comments are used to describe the code, so they are added to give you a description of what the CSS stylesheet is about, as you might have multiple stylesheet files.
2nd Jun 2016, 8:25 AM
James Flanders
+ 1
@Gabe Rust That's what I wrote, "hiding style definitions in the <head> section (Internal style sheet) from very old browsers". But that's useless as all browsers support CSS now. CSS was introduced in the 90s!
4th Jun 2016, 11:32 AM
ZinC
ZinC - avatar
+ 1
@ZinC Sorry, I did not see that post before.
4th Jun 2016, 3:41 PM
Gabe Rust
Gabe Rust - avatar
0
I wanna know the importance
2nd Jun 2016, 9:55 AM
Smukeliso
Smukeliso - avatar
0
because it helps to mark the beginning of CSS codes
2nd Jun 2016, 10:16 AM
Mohammad Fahad Sayed
Mohammad Fahad Sayed - avatar
0
Okay thanks
2nd Jun 2016, 10:18 AM
Smukeliso
Smukeliso - avatar
0
What do you mean by "comment the first line"? You can comment anywhere you like inside a stylesheet or an HTML file. Commenting your code helps you remember why you wrote a certain code snippet and what it does. It also helps others who may work on your files after you to understand why you wrote what you wrote. A useful comment in a fairly large HTML file may look like this: </div><!-- End of 'Container' -->. This could be helpful when there are several closing divs at the end of the page. Although most text editors have a feature that mark matching tags for you.
2nd Jun 2016, 12:59 PM
ZinC
ZinC - avatar
0
I mean comment on cascading style sheet not HTML document, because the CSS can be done in three categories which is link, selection and embedded, so I'm talking about the link style sheet
2nd Jun 2016, 2:42 PM
Smukeliso
Smukeliso - avatar
0
First, I encourage you and anyone who need help to post the code they're having problem with. It helps us who want to help you better understand the problem and hopefully provide the right answer for you. With that said, I still don't understand what you mean. I can only guess. I mentioned HTML comments in my earlier reply because this course is about learning HTML :) My second guess is, since you mentioned the three different ways of inserting a style sheet (External, internal and inline) is that you may be referring to hiding style definitions in the <head> section (Internal style sheet) from very old browsers that cannot accept them by using HTML comment around them. These browsers are now history and you shouldn't worry your mind about them.
3rd Jun 2016, 12:16 AM
ZinC
ZinC - avatar