Chapter 35: Marking-up Quotes

Inline with <q>

The q element can be used for a quote that is part of a sentence:

<p>She wrote <q>The answer is 42.</q> and everyone agreed.</p>

Quotation marks
Version ≤ 4.01

Quotation marks should not be added. User agents should (in HTML 4.01) resp. must (in HTML 4.0) render them
automatically.

Advertisement

Version = 5

Quotation marks must not be added. User agents will render them automatically.

Source URL (cite attribute)

Advertisement

The cite attribute can be used to reference the URL of the quoted source:

<p>She wrote <q cite="http://example.com/blog/hello-world">The answer is 42.</q> and everyone
agreed.</p>

Note that browsers typically don’t show this URL, so if the source is relevant, you should add a hyperlink (a element)
in addition.

Block with <blockquote>

The blockquote element can be used for a (block-level) quote:

Advertisement
<blockquote>
 <p>The answer is 42.</p>
</blockquote>

Source URL (cite attribute)

The cite attribute can be used to reference the URL of the quoted source:

<blockquote cite="http://example.com/blog/hello-world">
 <p>The answer is 42.</p>
</blockquote>

Note that browsers typically don’t show this URL, so if the source is relevant, you should add a hyperlink (a element)
in addition (see the section Citation/Attribution about where to place this link).

Advertisement

Citation/Attribution
Version ≤ 4.01

The citation/attribution should not be part of the blockquote element:

<blockquote cite="http://example.com/blog/hello-world">
 <p>The answer is 42.</p>
</blockquote>
<p>Source: <cite><a href="http://example.com/blog/hello-world" rel="external">Hello
World</a></cite></p>

You can add a div element to group the quote and the citation, but it exists no way to associate them semantically.

Advertisement

The cite element can be used for the reference of the quoted source (but not for the author name).
Version = 5

The citation/attribution (e.g., the hyperlink giving the source URL) can be inside the blockquote, but in that case it
must be within a cite element (for in-text attributions) or a footer element:

<blockquote cite="http://example.com/blog/hello-world">
 <p>The answer is 42.</p>
 <footer>
 <p>Source: <cite><a href="http://example.com/blog/hello-world" rel="external">Hello
World</a></cite></p>
 </footer>
</blockquote>

The cite element can be used for the reference of the quoted source, or for the name of the quote’s author.

Advertisement

Recent Posts

Securing phpMyAdmin Like a Pro: Essential Tips and Tricks

Securing phpMyAdmin is crucial to prevent unauthorized access and protect your databases. Here's a guide…

5 months ago

Pasqal raises $100M to build a neutral atom-based quantum computer

Pasqal, a Paris-based quantum computing startup, today announced that it has raised a $100 million…

1 year ago

Apple in talks with Disney, others on VR content for new headset: Report

Developed with Sony Group Corp, the headset will have two ultra-high-resolution displays to handle the…

1 year ago

Microsoft, Amazon results to highlight softening cloud business

After years of blistering growth, most recently fuelled by remote working and studying during the…

1 year ago

Intel chairman Omar Ishrak steps down

Omar Ishrak had stepped down and the chipmaker appointed board director Frank Yeary as his…

1 year ago

Canada to commercialise world's first photonic-based quantum computer

Canadian Prime Minister Justin Trudeau has announced a new federal investment to build and commercialise…

1 year ago