Loading...

HTML Quotations

You already marked importance and stress with formatting tags. Quotations are different: you are repeating someone else’s words (or a passage from a work), and HTML should say so clearly. Dedicated quote elements help browsers, assistive tools, and readers tell a quotation apart from your own surrounding prose — something decorative quotation marks alone do not fully communicate.

What counts as a quotation in HTML?

A quotation is text you present as coming from another speaker, writer, or source. It may be a short phrase inside your sentence or a longer passage set apart as its own block. HTML gives you q for the short inline case and blockquote for the longer block case. Extra tools help with sources: the cite element for a visible work title, and a cite attribute on blockquote for a machine-readable source URL.

Direct answer

Use q for a short quote inside a sentence. Use blockquote for a longer quoted section that stands on its own. Name the work or article with the cite element in visible text when it helps readers. On blockquote, you may also set cite="https://…" to a source URL — that URL is for machines and is not usually shown as the readable title by itself.

Quote tools at a glance

📊 q, blockquote, and cite

Tool Role Typical place
q Short inline quotation Inside a paragraph or sentence
blockquote Longer quoted passage Its own block, often with nested p
cite element Title of a work in visible text Running text near the quote
cite attribute Source URL for a blockquote On the blockquote start tag

Short inline quotes with q

When the quoted words sit inside your own sentence, wrap them in q. Most browsers add quotation marks for you. You still write the spoken or written words between the tags; you usually do not type decorative curly quotes by hand.

Inline quotation with q

html
HTML Code
<p>
She said <q>Practice every day</q> and closed the book.
</p>

Reading the example

  • The outer p is your narration
  • q wraps only the quoted phrase
  • Closing q returns the rest of the sentence to normal prose
  • If this were a long multi-sentence excerpt, blockquote would be the better fit

Longer passages with blockquote

Use blockquote when the quotation is long enough to stand as its own block — often one or more paragraphs. Put the quoted content inside the blockquote. A cite attribute can store the source URL. Put a human-readable work title in visible text with the cite element, usually near the quote.

Block quotation with source URL

html
HTML Code
<blockquote cite="https://example.com/tips">
<p>Clear HTML is easier to maintain than clever HTML.</p>
<p>Readers thank you for structure they can trust.</p>
</blockquote>

Why the cite attribute is not enough alone

The cite attribute helps tools and validators know the source URL. Many visitors never see attribute values. Give people a readable credit line as well.

Visible source title with cite

html
HTML Code
<p>Source: <cite>Example Tips</cite></p>

Choosing q vs blockquote

Ask two questions: How long is the quote? Does it interrupt a sentence or stand alone?

  • Short phrase inside your sentence → q
  • Longer passage as its own block → blockquote
  • Title of a book, article, or site in running text → cite element
  • URL of the source for a block quote → cite attribute on blockquote
    Do not wrap an entire page in one giant blockquote just to indent text. Indentation is presentation; blockquote is for real quotations.

Meaning vs quotation marks from CSS alone

You can fake marks with CSS or typed " characters. For a true quotation, prefer q or blockquote so the document marks the meaning. Visual marks can still appear — browsers often style q with quotes — but the element carries the role even if a stylesheet changes the look later.

Practice in your editor

  1. Write a paragraph that includes one short q quote from an imaginary coach or teacher.
  2. Add a blockquote with two short sentences from an imaginary article.
  3. Below it, add a line that uses cite to name the article title.
  4. Optionally set cite="https://example.com/article" on the blockquote.
  5. Save and open the page. Check that the inline quote and the block quote look distinct.
  6. Temporarily replace the q with plain text and typed quotes only, then put q back — notice how the markup role differs from decoration alone.

Mistakes that blur quotations

  • Wrapping a whole page in one giant blockquote with no real quotation
  • Using only CSS or typed marks when the text is truly quoted and should use q / blockquote
  • Putting the only source title inside the cite attribute and assuming readers will see it
  • Nesting blockquote inside q without a clear reason
  • Quoting yourself for decoration — save these elements for real cited words
  • Forgetting to close q or blockquote so later text stays marked as a quote

Summary

  • Short quotes inside a sentence → q
  • Longer quoted blocks → blockquote
  • Visible work titles → cite element
  • Optional source URL → cite attribute on blockquote
  • Mark real quotations in HTML; do not rely on styling alone for meaning
  • Keep quotes honest: use the elements when you are actually quoting a source

🧠 Test Your Knowledge

Ready to Start

Test Your Knowledge

Challenge yourself with this interactive quiz and see how well you understand the topic

❓
7
Questions
🎯
70%
To Pass
♾️
∞
Time
🔄
∞
Attempts

📝 Instructions

  • Read each question carefully
  • Select the best answer for each question
  • You can retake the quiz as many times as you want
  • Your progress will be shown at the top