This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by ViVi
over 8 years

Trouble understanding purpose of comments

Hello,

I’m having trouble understanding the purpose of using comments in HTML and CSS /* */. Could someone please explain in which situation would we need to use these comment signs? Thank you so much!

Vi

Answer 55bd54ea9376760a56000385

0 votes

Permalink

Comments allow the author to document the code so others (self included) can read and understand what is going on. We can use comments as labels, as well. In a template, for instance,

<!-- seo plug-in goes here -->

<!-- end of seo plug-in -->

/* navigation */

/* side bar widget */

and so on. Comments are not part of the document, and are ignored by the browser but are very handy months down the road when a lot of details have been forgotten.

points
Submitted by Roy
over 8 years

1 comments

ViVi over 8 years

I got it. Thanks a lot!