0
Anyone can explain to me, why it is important to comment the first line in CSS sheets?
9 ответов
+ 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.
+ 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!
+ 1
@ZinC
Sorry, I did not see that post before.
0
I wanna know the importance
0
because it helps to mark the beginning of CSS codes
0
Okay thanks
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.
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
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.