Home »
HTML
HTML Comments and Quotations
By IncludeHelp Last updated : October 13, 2024
HTML Comments
To insert a comment in an HTML document, the comment tags are used. The comments are used to provide some information that could be useful for anyone who views the code of the webpage. The comments can be inserted by any number of times within the webpage. Also, a notable point is that the comments are not visible on the webpage. That means the text in the comments are ignored by the web browser and thus it is not visible on the webpage.
The HTML comments are placed between the symbols <!-- text -->
Syntax
The syntax of the comment tag is as,
<!--
This is a comment in the HTML document.
-->
The comments could be inserted in wherein the document. It increases the readability of the code in the document. Also, the comments in HTML are supported by almost all of the present-day browsers. These comments are multi-line comments.
Example
Below is an example to illustrate the use of comments,
<!-- The sample HTML code -->
<html>
<body>
<p>Line before the comment.</p>
<!--
This is the comment line
any text can be written here
that will not display on the webpage.
-->
<p>Line after the comment.</p>
</body>
</html>
Output
HTML Quotation
<q> elements: The quotations in HTML document are added by using the <q> tag. The text which is to be displayed in quotes is written in between the <q> tag.
Example
<p>Welcome at <q>IncludeHelp</q>.</p>
Output
Welcome at "IncludeHelp".
The <q> tag is used for the small quotation in the text.
HTML <blockqoute> Element
The <blockquote> element is also used for creating quotations. But it is somewhat different from the <q> element. Unlike the <q> tag, the <blockqoute> do not put quotations(") in the text, but it changes the alignment of the text to make it different from other texts on the webpage. The browser generally intends the content in the BLOCKQUOTE tag.
Example
An example of <blockqoute> tag
<!-- The sample HTML code -->
<html>
<body>
<p>
the text is blockqoute is quoted differently then the other text
<blockquote> some text in the BLOCKQOUTE element </blockquote>
</p>
</body>
</html>
Output
HTML <address> Element
The <address> element specifies an address within the webpage and the text that is inside the address tag would be emphasized. It also has both the tags: opening and closing tags.
Example
An example of <address> tag
<!-- The sample HTML code -->
<html>
<body>
<address>
<p>
Address:<br>
123-block, LN road<br>
Sector-110, Delhi
</p>
</address>
</body>
</html>
Output
HTML <abbr> element
The <abbr> element is used to define a text as an acronym or abbreviations. The title attribute can be used to show the full version of the abbreviation/acronym when you mouse over the <abbr> element. It has both opening and closing tags.
Example
An example of <abbr> tag
<!-- The sample HTML code -->
<html>
<body>
<p>
place your mouse over the following text :
<abbr title=" World Wide Web "> www </abbr>
</p>
</body>
</html>
Output