Interactive online courses HTML Academy
2026-03-09 12:55 Diff

The pevious task’s blog entry described tags that are used for marking up quotes. And this is great, because now in the text you need to quote the boss’s direct speech.

HTML has two tags for marking up quotes. The simplest is the <q> tag (which is short for “quote”). It is designed to call out quotes within a sentence. The browser automatically frames the text inside the tag with quotation marks. Therefore, you don’t need to add quotation marks manually.

If you know the Internet address of the quote, you can specify it in the attribute cite:

The specification states: <q cite="https://www.w3.org/TR/html52/">The q element represents some phrasal content that is quoted from another source.</q>.

But do not confuse the cite attribute with the tag of the same name <cite>, which can also be applied to quotes. The tag <cite> is the “extended version” of the attribute cite. In addition to providing the address of the quotation source, you can also use this tag to indicate the name of the work that the text is quoted from as well as the name of the author or organization to which the text can be attributed. By default, the contents of the <cite> tag are formatted in italics in the browser.

When the tags <q> and <cite> are used together, they are placed next to each other:

<p>According to <cite>Charles Bukowski</cite>, <q>An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way.</q></p>

The <cite> tag can be used independently, and it does not have to be used with a quote:

<p>Who is your favorite doctor? (In the series <cite>Doctor Who</cite>)</p>