- HTML Text Formatting
- Paragraphs and Headings
- Lists
- Quoting a Block of Text
- Formatting Text Inline
- Marking Up Code
- Wrapping Up
Quoting a Block of Text
Traditionally, in printed material, quotations of substantial amounts of text are set apart from the surrounding content by indentations or changing the type style. HTML includes the block-level element <blockquote> (which conveniently contains “block” in its name) to accomplish the same thing in the browser. By default, <blockquote> elements are indented compared to other block elements, but you can use CSS to change the indentation.
To provide a source for the quotation, include the cite attribute with the URL of the source as its value. You can also use the <cite> element to give the title of the source in text (CODE 4.1, FIGURE 4.4). It’s normally styled in italics by the browser, but you can change that with CSS. If you wish to provide a link to the source as well, combine the <cite> element with an <a> element.
FIGURE 4.4 Code 4.1 as rendered in a browser
To quote a paragraph with citation:
Type <blockquote>.
Type <p>.
Type the quote.
Type </p>.
Type <cite>.
Type the source of the quote.
Type </cite>.
Type </blockquote>.