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

<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

<!DOCTYPE html>
<html>
<head>
  <title>Q Tag Example</title>
  <style>
    .inline-quote {
      color: #2c3e50;
      font-style: italic;
    }
  </style>
</head>
<body>
  <h1>HTML &lt;q&gt; 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

Use our TryIt Editor to see the output.

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

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.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend