HTML Tags

HTML <q> Tag

The <q> tag is used to define a short inline quotation.
Browsers usually display the quoted text with quotation marks automatically.
It is an inline element and suitable for single sentences or short phrases.

Syntax

html

<q cite="source-url">Short quoted text</q>

Attributes

AttributeDescription
citeURL of the source of the quotation.
classAssigns one or more class names for styling.
idAssigns a unique identifier to the element.
styleAdds inline CSS styles to customize appearance.
titleProvides additional information as a tooltip.

Example

html

<!DOCTYPE html>
<html>
<head>
  <title>Q Tag Example</title>
  <style>
    .inline-quote {
      color: #2c3e50;
      font-style: italic;
    }
  </style>
</head>
<body>
  <h1>HTML <q> Tag Example</h1>
  <p>
    Albert Einstein once said: <q class="inline-quote" cite="https://www.example.com" title="Einstein Quote">Imagination is more important than knowledge.</q>
  </p>
</body>
</html>

Output

Browser Output

html

Use our TryIt Editor to see the output.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

The text appears inline with quotation marks around it. The cite and title attributes are not directly visible.

Notes

  • <q> is an inline element and does not break the line.
  • The cite attribute provides semantic reference for the source. It visually can't be seen.
  • CSS can style the quotation (color, font-style, spacing).
  • Ideal for short quotes inside a paragraph.

Conclusion

The <q> tag is used for short inline quotations.
It automatically adds quotation marks around the text and supports semantic source referencing.