!-- // Comment tags

liunx

Guest
Hi,<br />
<br />
Which of the three comment tags prefered and can they be used at any time?<br />
<br />
< !-- comment -- ><br />
// comment //<br />
/* comment */<br />
<br />
How are they different?<br />
<br />
Thanks,<br />
G閶榙閶杅<br />
:D<!--content-->< !-- comment -- ><br />
are the only ones that can be used in html<br />
<br />
the others can be used in most server side langues, and the /* */ comments can be used in CSS (C style comments if i remember correctly)<!--content--><--this is an HTML comment --><br />
// this is a one line comment<br />
/*this is <br />
a <br />
multiline comment */<br />
<br />
i don't really use comments in CSS but in javascript i know that the /* is a multiline comment and // is single line<!--content-->Actually, "//" and "/* */" are only used in PHP, as far as server-side languages go. ASP uses a single quote, and Perl uses a # (neither has multi-line comments).<br />
<br />
Rys<!--content-->PHP also uses #<!--content-->/* CSS Comments (<!-- m --><a class="postlink" href="http://css.maxdesign.com.au/selectutorial/rules_comments.htm">http://css.maxdesign.com.au/selectutori ... mments.htm</a><!-- m -->) */<br />
This type of comment is also used in many programming languages, for instance C, C++, Java, etc. These comments are generally called "block comments" since they can span any number of lines and be placed nearly anywhere in the code.<br />
<br />
// C or Java Comments<br />
This style of commenting does not work in HTML or CSS. These are called "end of line comments." Notice the lack of closing on the comment block. This style of comment can not span lines, nor can there be code after it on the same line.<br />
<br />
<!-- HTML/XHTML/XML comment --><br />
These comments are strictly for HTML, XHTML, and XML. They are similar to the block comments shown above, but there are a few more limitations on where they can be placed.<br />
<br />
For more information, you can go to this paper on comments in programming languages (<!-- m --><a class="postlink" href="http://www.gavilan.edu/csis/languages/comments.html">http://www.gavilan.edu/csis/languages/comments.html</a><!-- m -->).<!--content-->
 
Top