Contents
HTML Quote Tag: Main Tips
- HTML
q
tags surround an inline quotation element that doesn't need paragraph breaks. - For a longer quote, you may use <blockquote> tags that create a block quotation element.
- You must include both starting and ending HTML quote tags.
q
tags are used with thecite
attribute and also support global ones.
Using q Tags
HTML quote tags indicate that the enclosed text is an inline quotation:
<p>Everyone knows that
<q cite="https://www.bitdegree.org/learn/html-basics">HTML is an acronym for Hypertext Markup Language.</q>
</p>
Most browsers use these settings to display HTML quote elements by default:
q {
display: inline;
}
q:before {
content: open-quote;
}
q:after {
content: close-quote;
}
As you can see, modern browsers automatically surround the element content with HTML quotation marks. If you're using an older browser, you might need a style rule to add them.
The cite Attribute for HTML Quote
HTML q
tags are usually used with the cite
attribute which specifies the URL source of the quote. However, it is not displayed by the browser:
<p>It is a clear that
<q cite="https://www.bitdegree.org">gamified online education boosts motivation.</q>
</p>
Warning: don't confuse this attribute with the <cite> tag, which is used to define the title for a creative work or quote.