Quotes

In this lesson, we'll learn how to add various kinds of quotes in HTML.

We'll cover the following

In documents, especially in publications, we often use and quote external sources. In HTML two tags, <q> and <blockquote> can be used to mark these citations.

In Chapter 3 (Rendering Text), you tangentially learned about the <q> tag, as a way of formatting text.

To be more precise, <q> is a simpler text formatting tag, as it adds a special semantic to its content: this is a quotation that comes from another source.

While <q> is an inline tag, <blockquote> defines a block (section) of citation. Both elements have a cite attribute that specifies the URL pointing to the source of the quotation.

Listing 5-3 shows a short example of these tags.

Listing 5-3: Using quotes

Get hands-on with 1200+ tech skills courses.