answersLogoWhite

0


Best Answer

Adding a comment in HTML is very useful so that you can quickly see what a section of code is supposed to be doing. It also can be useful to define who wrote a piece of code when multiple people are on a project together.

To create a comment line you start with the < character followed by an exlamation mark and then two dashes. You then type your comment and close it off with two dashes and the > character. See example below.

<!-- This is a comment line -->

You can also add more dashes at the beginning or in the middle with no ill effects. See example below.

<!-------- This is another --- comment line -->

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Comments in an HTML document serve the same purpose as comments in any programming language. They're used to help the coder delineate between sections of the code, for whatever reason. They are also used to provide information about decisions that the coder has made that might later be confusing or questionable.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

HTML/XHTML comments look the same as XML comments. There is only one way of making them:

<!-- Comment content -->

Content can span multiple lines, and contain any characters, excluding --> (for obvious reasons.)

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Writing a comment in an HTML document uses the following syntax <!--stuffstuffstuff-->. Of course the comments function just like other languages. They always begin with "<!--" and end with "-->". I hope I answered your question!

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

You use a less than sign followed by an exclamation mark and two hyphens to open a comment and two hyphens and a greater than sign to close the comment, as in the following example:

<!-- This text would be a HTML comment. -->

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

<!-- here is a comment --> HTML style lol

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Comments can be placed in an HTML document using after.

Example:

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a comment tag on HTML document?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is document tag in HTML?

HTML does not have a DOCUMENT tag. The closest thing it has is DOCTYPE, which specifies which specification of HTML (there are several versions) is being used for that page.


What should be the last command in any HTML document?

The last command in any HTML document is a closing HTML tag. Just before it is the closing BODY tag. &lt;/BODY&gt; &lt;HTML&gt;


What is the first tag in every HTML document?

The HTML document begins,and ends with the tag . The element defines the whole HTML document. The element has a start tag and an end tag The Start element Tags within the HTML tags begins the content to be displayed for the web page (end body tag) The basic Tags needed to start an HTML document (and must be ended) look like this: This is where the content goes


Which tag tells the Web browser that the document file contains HTML?

The &lt;html&gt; tag at the top and the bottom tells the browsers. It is defined as &lt;html&gt; and &lt;/html&gt; at bottom.


What is the head tag in HTML document?

The &lt;head&gt; at the beginning of an HTML document comes between &lt;html&gt; and &lt;body&gt;. It is a container that includes information that relates to the entire document. You can include the following tags in the &lt;head&gt; tag: &lt;title&gt; (required in an HTML document), &lt;style&gt;, &lt;base&gt;, &lt;link&gt;, &lt;meta&gt;, &lt;script&gt;, and &lt;noscript&gt;.


How do you write HTML codes and javascript events together in your HTML kit?

You need to write the HTML code in the tag format. If you want to write JavaScript put it in &lt;script&gt; tag.


How do you add HTML tag within javascript?

Unless it is in a comment, you can't


What HTML tag is used to mark the top of the page?

The first tag you use when developing an HTML document is the tag. The first tag you use for the main content of your page is the tag. is the tag that marks the top of an HTML page. The minimum required first like is , which starts the definition of the page content.


Differentiate HTML tag from an HTML documents?

HTML tags are used to delimit HTML elements inside an HTML document.


What is role of the COMMENT tag in HTML?

The comment tag makes it easier to navigate the HTML document as a developer. Comments can be used to denote tricky bits of code, or to help organize the code so you know where one thing starts and another ends without having to read the whole document. This way, when you go back to a HUGE HTML file you build in 1999, you (or your successor) won't get tripped up by the same mistakes you made the first time around.


What characters cannot be included in an HTML comment?

There are no restrictions on which character cannot be placed in the comment tag, as As it is not --&gt;, since that will end the comment.


What is the fundamental unit of HTML syntax?

the &lt;&gt; brackets, for example to begin an HTML document you begin with the tag &lt;html&gt;