HTML q Tag defines the short quotation that are displayed inside the main paragraph or element. HTML q Tag is an inline element. Cite attribute is used to define URL of the source of that quotation.
Table of Contents
Syntax of HTML q Tag
The Syntax of HTML q Tag is shown below, It has both starting tag and ending tag.
<q>
</q>
Usage of HTML q Tag
HTML q Tag is used to insert quotations into the main text on a webpage. This is used for short quotation.
For long quotation use blockquote tag.
Example of HTML q Tag
Simple example of HTML q Tag is given below.
<p>Albert Einstein said <q>Logic will get you from A to Z; imagination will get you everywhere.</q> on comparison of logic and imagination.</p>
Output
Albert Einstein said Logic will get you from A to Z; imagination will get you everywhere.
on comparison of logic and imagination.
In above example we have used q tag to insert a quote of Albert Einstein.
Note that the text inside HTML q tag has double quotation marks around it.
Browser Support for HTML q Tag
HTML q Tag is supported by all major browsers which include Chrome, Opera, Firefox, Edge and Safari.
Global Attributes Support in HTML q Tag
The HTML q Tag supports all Global Attributes.
Event Attributes Support in HTML q Tag
The HTML q Tag supports all Event Attributes.