It’s Festive Season! Enjoy 30% Off

Use code FESTIVE30 at checkout

Code has been added to clipboard!

HTML Quote Tag

Reading time 1 min
Published Jun 29, 2017
Updated Oct 3, 2019

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 the cite attribute and also support global ones.

Using q Tags

HTML quote tags indicate that the enclosed text is an inline quotation:

Example
<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:

Example
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:

Example
<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.

Browser Support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
1+
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile Browser Support

Browser image
Chrome
All
Browser image
Firefox
4+
Browser image
Opera
All
Browser image
Safari
All