In this section, we will learn what HTML <q> element is and how to use it.
What is <q> Tag in HTML?
HTML <q> element stands for quote and we use it when we have a quoted content.
Basically, the value of this element is the quoted content.
Also, browsers add a double quotation (“ “) to surround the quoted content.
Note: this element is intended for short quotes. So if you have a long quoted content (like in size of a paragraph) it’s better to use HTML <blockquote> element instead.
HTML <q> Tag Syntax:
<q> quoted content </q>
Example: using <q> tag in HTML
See the Pen using <q> tag in HTML by Omid Dehghan (@odehghan) on CodePen.
HTML <q> Tag Attributes
HTML <q> element has only one attribute, and that is `cite`.
If the quoted content that we brought into an HTML document is coming from an external resource (a webpage) and we have the address of that webpage, we need to set the address as the value of the `cite` attribute to mention what’s the resource of the quoted content.