SyntaxStudy
Sign Up
HTML Beginner 5 min read

HTML Quotations

HTML Quotations

HTML has several elements for marking up quotations. The <blockquote> element represents a section quoted from an external source. Browsers usually render it indented. The cite attribute can hold the URL of the source.

Inline Quotes and Citations

For short, inline quotations use <q> — browsers automatically add quotation marks. The <cite> element represents the title of a creative work (a book, song, film, etc.) and is rendered in italics by default. These elements communicate structure to assistive technologies.

  • <blockquote cite="url"> — Long block quote
  • <q> — Short inline quotation
  • <cite> — Title of a work
Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Quotations</title>
</head>
<body>
  <h1>Famous Quotes</h1>

  <blockquote cite="https://en.wikiquote.org/wiki/Albert_Einstein">
    <p>Imagination is more important than knowledge.</p>
    <footer>— Albert Einstein</footer>
  </blockquote>

  <p>Einstein once said <q>A person who never made a
  mistake never tried anything new.</q></p>

  <p>My favourite book is
  <cite>The Pragmatic Programmer</cite>.</p>
</body>
</html>
Pro Tip

Always include the cite attribute on <blockquote> with the URL of the source — it makes the document more credible and helps search engines understand context.