2 Typography

Typography and typesetting elements

2.1 Headings link

Any header elements may include links, as depicted in the examples. The secondary header above is an h2 element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an h2 unless you need a header level of less importance, or as a sub-header to an existing h2 element.

Usage

H1 Top-Level Header Link

H2 Second-Level Header Link

H3 Third-Level Header Link

H4 Fourth-Level Header Link

H5 Fifth-Level Header Link
H6 Sixth-Level Header Link
<h1>H1 Top-Level Header <a href="#">Link</a></h1>
<h2>H2 Second-Level Header <a href="#">Link</a></h2>
<h3>H3 Third-Level Header <a href="#">Link</a></h3>
<h4>H4 Fourth-Level Header <a href="#">Link</a></h4>
<h5>H5 Fifth-Level Header <a href="#">Link</a></h5>
<h6>H6 Sixth-Level Header <a href="#">Link</a></h6>

2.2 Copy link

The following font is applied to body copy using typekit: font-family: proxima-nova, sans-serif, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif using the font size of 16px

2.3 Grouping link

Various elements can be used to group content effectively. NOTE: some of these elements inherit styling from Foundation.

2.3.1 Paragraphs link

All paragraphs are wrapped in p tags. Additionally, p elements can be wrapped with a blockquote element if the p element is indeed a quote. Historically, blockquote has been used purely to force indents, but this is now achieved using CSS. Reserve blockquote for quotes.

Usage

All paragraphs are wrapped in p tags.

<p>All paragraphs are wrapped in <code>p</code> tags.</p>

2.3.2 Horizontal Rule link

The hr element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book. The following extract from Pandora’s Star by Peter F. Hamilton shows two paragraphs that precede a scene change and the paragraph that follows it:

Usage

Dudley was ninety-two, in his second life, and fast approaching time for another rejuvenation. Despite his body having the physical age of a standard fifty-year-old, the prospect of a long degrading campaign within academia was one he regarded with dread. For a supposedly advanced civilization, the Intersolar Commonwearth could be appallingly backward at times, not to mention cruel.

Maybe it won’t be that bad, he told himself. The lie was comforting enough to get him through the rest of the night’s shift.


The Carlton AllLander drove Dudley home just after dawn. Like the astronomer, the vehicle was old and worn, but perfectly capable of doing its job. It had a cheap diesel engine, common enough on a semi-frontier world like Gralmond, although its drive array was a thoroughly modern photoneural processor. With its high suspension and deep-tread tyres it could plough along the dirt track to the observatory in all weather and seasons, including the metre-deep snow of Gralmond’s winters.

<p>Dudley was ninety-two, in his second life, and fast approaching time for another rejuvenation. Despite his body having the physical age of a standard fifty-year-old, the prospect of a long degrading campaign within academia was one he regarded with dread. For a supposedly advanced civilization, the Intersolar Commonwearth could be appallingly backward at times, not to mention cruel.</p>
<p><i>Maybe it won&#8217;t be that bad</i>, he told himself. The lie was comforting enough to get him through the rest of the night&#8217;s shift.</p>
<hr/>
<p>The Carlton AllLander drove Dudley home just after dawn. Like the astronomer, the vehicle was old and worn, but perfectly capable of doing its job. It had a cheap diesel engine, common enough on a semi-frontier world like Gralmond, although its drive array was a thoroughly modern photoneural processor. With its high suspension and deep-tread tyres it could plough along the dirt track to the observatory in all weather and seasons, including the metre-deep snow of Gralmond&#8217;s winters.</p>

2.3.3 Pre-Formatted Text link

The pre element represents a block of pre-formatted text, in which structure is represented by typographic conventions rather than by elements. Such examples are an e-mail (with paragraphs indicated by blank lines, lists indicated by lines prefixed with a bullet), fragments of computer code (with structure indicated according to the conventions of that language) or displaying ASCII art. Here’s an example showing the printable characters of ASCII:

Usage

  ! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~
<pre><samp>&#32; ! " # $ % &amp; ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~</samp></pre>

2.3.4 Blockquotes link

The blockquote element represents a section that is being quoted from another source.

Usage

Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed, it has been said that democracy is the worst form of government except all those other forms that have been tried from time to time.

<blockquote cite="http://hansard.millbanksystems.com/commons/1947/nov/11/parliament-bill#column_206">
    <p>Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed, it has been said that democracy is the worst form of government except all those other forms that have been tried from time to time.</p>
</blockquote>

2.4 Lists link

Styles for both ordered and unordered lists are available. Include block elements within a single list item as appropriate. Sometimes we may want each list item to contain block elements, typically a paragraph or two.

Usage

  • The British Isles is an archipelago consisting of the two large islands of Great Britain and Ireland, and many smaller surrounding islands.

    Great Britain is the largest island of the archipelago. Ireland is the second largest island of the archipelago and lies directly to the west of Great Britain.

  • The full list of islands in the British Isles includes over 1,000 islands, of which 51 have an area larger than 20 km2.

<!-- example of a list using multiple block level elements inside the li -->
<ul>
    <li>
        <p>The British Isles is an archipelago consisting of the two large islands of Great Britain and Ireland, and many smaller surrounding islands.</p>
        <p>Great Britain is the largest island of the archipelago. Ireland is the second largest island of the archipelago and lies directly to the west of Great Britain.</p>
    </li>
    <li>
        <p>The full list of islands in the British Isles includes over 1,000 islands, of which 51 have an area larger than 20 km<sup>2</sup>.</p>
    </li>
</ul>

2.4.1 Ordered List link

The ol element denotes an ordered list, and various numbering schemes are available through the CSS (including 1,2,3… a,b,c… i,ii,iii… and so on). Each item requires a surrounding <li> and </li> tag, to denote individual items within the list (as you may have guessed, li stands for list item).

Usage

  1. This is an ordered list.
  2. This is the second item, which contains a sub list
    1. This is the sub list, which is also ordered.
    2. It has two items.
  3. This is the final item on this list.
<ol>
    <li>This is an ordered list.</li>
    <li>
        This is the second item, which contains a sub list
        <ol>
            <li>This is the sub list, which is also ordered.</li>
            <li>It has two items.</li>
        </ol>
    </li>
    <li>This is the final item on this list.</li>
</ol>

2.4.2 Unordered List link

The ul element denotes an unordered list (ie. a list of loose items that don’t require numbering, or a bulleted list). Again, each item requires a surrounding <li> and </li> tag, to denote individual items. Here is an example list showing the constituent parts of the British Isles:

Usage

  • United Kingdom of Great Britain and Northern Ireland:
    • England
    • Scotland
    • Wales
    • Northern Ireland
  • Republic of Ireland
  • Isle of Man
  • Channel Islands:
    • Bailiwick of Guernsey
    • Bailiwick of Jersey
<ul>
    <li>
        United Kingdom of Great Britain and Northern Ireland:
        <ul>
            <li>England</li>
            <li>Scotland</li>
            <li>Wales</li>
            <li>Northern Ireland</li>
        </ul>
    </li>
    <li>Republic of Ireland</li>
    <li>Isle of Man</li>
    <li>
        Channel Islands:
        <ul>
            <li>Bailiwick of Guernsey</li>
            <li>Bailiwick of Jersey</li>
        </ul>
    </li>
</ul>

2.4.3 Definition List link

The dl element is for another type of list called a definition list. Instead of list items, the content of a dl consists of dt (Definition Term) and dd (Definition description) pairs. Though it may be called a “definition list”, dl can apply to other scenarios where a parent/child relationship is applicable. For example, it may be used for marking up dialogues, with each dt naming a speaker, and each dd containing his or her words.

Usage

This is a term.
This is the definition of that term, which both live in a dl.
Here is another term.
And it gets a definition too, which is this line.
Here is term that shares a definition with the term below.
Here is a defined term.
dt terms may stand on their own without an accompanying dd, but in that case they share descriptions with the next available dt. You may not have a dd without a parent dt.
<dl>
    <dt>This is a term.</dt>
    <dd>This is the definition of that term, which both live in a <code>dl</code>.</dd>
    <dt>Here is another term.</dt>
    <dd>And it gets a definition too, which is this line.</dd>
    <dt>Here is term that shares a definition with the term below.</dt>
    <dt>Here is a defined term.</dt>
    <dd><code>dt</code> terms may stand on their own without an accompanying <code>dd</code>, but in that case they <em>share</em> descriptions with the next available <code>dt</code>. You may not have a <code>dd</code> without a parent <code>dt</code>.</dd>
</dl>

2.5 Figures link

Figures are usually used to refer to images. When you wish to cite the source of a quote, you should do so using a figure also.

Usage

Example image
This is a placeholder image, with supporting caption.

‘Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.

Jabberwocky (first verse). Lewis Carroll, 1832-98

Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed, it has been said that democracy is the worst form of government except all those other forms that have been tried from time to time.

Winston Churchill, in a speech to the House of Commons. 11th November 1947
<!-- image example -->
<figure>
    <img src="http://lorempixel.com/680/400/abstract" alt="Example image"/>
    <figcaption>
        This is a placeholder image, with supporting caption.
    </figcaption>
</figure>
<!-- text example -->
<figure>
    <p>&#8216;Twas brillig, and the slithy toves<br/>
    Did gyre and gimble in the wabe;<br/>
    All mimsy were the borogoves,<br/>
    And the mome raths outgrabe.</p>
    <figcaption>
        <cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98
    </figcaption>
</figure>
<!-- figcaption used as a citation -->
<blockquote cite="http://hansard.millbanksystems.com/commons/1947/nov/11/parliament-bill#column_206">
    <p>Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed, it has been said that democracy is the worst form of government except all those other forms that have been tried from time to time.</p>
</blockquote>
<figcaption>
    Winston Churchill, in <cite><a href="http://hansard.millbanksystems.com/commons/1947/nov/11/parliament-bill#column_206">a speech to the House of Commons</a></cite>. 11th November 1947
</figcaption>

2.6 Text Semantics link

There are a number of inline HTML elements you may use anywhere within other elements.

2.6.1 Links and anchors link

The a element is used to hyperlink text, be that to another page, a named fragment on the current page or any other location on the web. as placed within paragraphs will get special styles to visually distinguish them from regular copy.

<a href="/">Home</a>
<p><a href="/">Go to the home page</a> or <a href="#banner">return to the top of this page</a>.</p>

2.6.2 Emphasis and Italic, Strong and Bold link

The em element is used to denote text with stressed emphasis, i.e., something you’d pronounce differently. Where italicizing is required for stylistic differentiation, the i element may be preferable.

The i element is used for text in an alternate voice or mood, or otherwise offset from the normal prose. Examples include taxonomic designations, technical terms, idiomatic phrases from another language, the name of a ship or other spans of text whose typographic presentation is typically italicised.

The strong element is used to denote text with strong importance. Where bolding is used for stylistic differentiation, the b element may be preferable.

The b element is used for text stylistically offset from normal prose without conveying extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typographic presentation is typically emboldened.

Usage

You simply must try the negitoro maki!

There is a certain je ne sais quoi in the air.

Don’t stick nails in the electrical outlet.

You enter a small room. Your sword glows brighter. A rat scurries past the corner wall.

<p>You simply <em>must</em> try the negitoro maki!</p>
<p>There is a certain <i lang="fr">je ne sais quoi</i> in the air.</p>
<p><strong>Don&#8217;t</strong> stick nails in the electrical outlet.</p>
<p>You enter a small room. Your <b>sword</b> glows brighter. A <b>rat</b> scurries past the corner wall.</p>

2.6.3 Small Print link

The small element is used to represent disclaimers, caveats, legal restrictions, or copyrights (commonly referred to as ‘small print’). It can also be used for attributions or satisfying licensing requirements.

Usage

Copyright © 1922-2011 Acme Corporation. All Rights Reserved.

<p><small>Copyright &#169; 1922-2011 Acme Corporation. All Rights Reserved.</small></p>

2.6.4 Strikethrough vs. Del link

The s element is used to represent content that is no longer accurate or relevant. When indicating document edits i.e., marking a span of text as having been removed from a document, use the del element instead.

The del element is used to represent deleted or retracted text which still must remain on the page for some reason. Meanwhile its counterpart, the ins element, is used to represent inserted text. Both del and ins have a datetime attribute which allows you to include a timestamp directly in the element.

Usage

Recommended retail price: £3.99 per bottle
Now selling for just £2.99 a bottle!

She bought two five pairs of shoes.

<s>Recommended retail price: &#163;3.99 per bottle</s><br/><strong>Now selling for just &#163;2.99 a bottle!</strong>
<p>She bought <del datetime="2005-05-30T13:00:00">two</del> <ins datetime="2005-05-30T13:00:00">five</ins> pairs of shoes.</p>

2.6.5 Citations link

The cite element is used to represent the title of a work (e.g. a book, essay, poem, song, film, TV show, sculpture, painting, musical, exhibition, etc). This can be a work that is being quoted or referenced in detail (i.e. a citation), or it can just be a work that is mentioned in passing.

Usage

Universal Declaration of Human Rights, United Nations, December 1948. Adopted by General Assembly resolution 217 A (III).

<p><cite>Universal Declaration of Human Rights</cite>, United Nations, December 1948. Adopted by General Assembly resolution 217 A (III).</p>

2.6.6 Inline quotes link

The q element is used for quoting text inline. Example showing nested quotations:

Usage

John said, I saw Lucy at lunch, she told me Mary wants you to get some ice cream on your way home. I think I will get some at Ben and Jerry’s, on Gloucester Road.

<p>John said, <q>I saw Lucy at lunch, she told me <q>Mary wants you to get some ice cream on your way home</q>. I think I will get some at Ben and Jerry&#8217;s, on Gloucester Road.</q></p>

2.6.7 Definition link

The dfn element is used to highlight the first use of a term. The title attribute can be used to describe the term.

Usage

Bob’s canine mother and equine father sat him down and carefully explained that he was an allopolyploid organism.

<p>Bob&#8217;s <dfn title="Dog">canine</dfn> mother and <dfn title="Horse">equine</dfn> father sat him down and carefully explained that he was an <dfn title="A mutation that combines two or more sets of chromosomes from different species">allopolyploid</dfn> organism.</p>

2.6.8 Abbreviation link

The abbr element is used for any abbreviated text, whether it be acronym, initialism, or otherwise. Generally, it’s less work and useful (enough) to mark up only the first occurrence of any particular abbreviation on a page, and ignore the rest. Any text in the title attribute will appear when the user’s mouse hovers the abbreviation (although notably, this does not work in Internet Explorer for Windows).

Usage

BBC, HTML, and Staffs.

<p><abbr title="British Broadcasting Corportation">BBC</abbr>, <abbr title="HyperText Markup Language">HTML</abbr>, and <abbr title="Staffordshire">Staffs.</abbr></p>

2.6.9 Time link

The time element is used to represent either a time on a 24 hour clock, or a precise date in the proleptic Gregorian calendar, optionally with a time and a time-zone offset.

Usage

Queen Elizabeth II was proclaimed sovereign of each of the Commonwealth realms on and , after the death of her father, King George VI.

<p>Queen Elizabeth II was proclaimed sovereign of each of the Commonwealth realms on <time datetime="1952-02-6">6</time> and <time datetime="1952-02-7">7 February 1952</time>, after the death of her father, King George VI.</p>

2.6.10 Code link

The code element is used to represent fragments of computer code. Useful for technology-oriented sites, not so useful otherwise.

Usage

When you call the activate() method on the robotSnowman object, the eyes glow.

function getJelly() {
    echo $aDeliciousSnack;
}
<!-- used inline -->
<p>When you call the <code>activate()</code> method on the <code>robotSnowman</code> object, the eyes glow.</p>
<!-- used in conjunction with pre -->
<pre><code>function getJelly() {
&#160;&#160;&#160;&#160;echo $aDeliciousSnack;
}</code></pre>

2.6.11 Variable link

The var element is used to denote a variable in a mathematical expression or programming context, but can also be used to indicate a placeholder where the contents should be replaced with your own value.

Usage

If there are n pipes leading to the ice cream factory then I expect at least n flavours of ice cream to be available for purchase!

<p>If there are <var>n</var> pipes leading to the ice cream factory then I expect at <em>least</em> <var>n</var> flavours of ice cream to be available for purchase!</p>

2.6.12 Sample output link

The samp element is used to represent (sample) output from a program or computing system. Useful for technology-oriented sites, not so useful otherwise.

Usage

The computer said Too much cheese in tray two but I didn’t know what that meant.

<p>The computer said <samp>Too much cheese in tray two</samp> but I didn&#8217;t know what that meant.</p>

2.6.13 Keyboard entry link

The kbd element is used to denote user input (typically via a keyboard, although it may also be used to represent other input methods, such as voice commands).

Usage

To take a screenshot on your Mac, press ⌘ Cmd + ⇧ Shift + 3.

<p>To take a screenshot on your Mac, press <kbd>&#8984; Cmd</kbd> + <kbd>&#8679; Shift</kbd> + <kbd>3</kbd>.</p>

2.6.14 Superscript and subscript text link

The sup element represents a superscript and the sub element represents a sub. These elements must be used only to mark up typographical conventions with specific meanings, not for typographical presentation. As a guide, only use these elements if their absence would change the meaning of the content.

Usage

The coordinate of the ith point is (xi, yi). For example, the 10th point has coordinate (x10, y10).

f(x, n) = log4xn

<p>The coordinate of the <var>i</var>th point is (<var>x<sub><var>i</var></sub></var>, <var>y<sub><var>i</var></sub></var>). For example, the 10th point has coordinate (<var>x<sub>10</sub></var>, <var>y<sub>10</sub></var>).</p>
<p>f(<var>x</var>, <var>n</var>) = log<sub>4</sub><var>x</var><sup><var>n</var></sup></p>

2.6.15 Marked or highlighted text link

The mark element is used to represent a run of text marked or highlighted for reference purposes. When used in a quotation it indicates a highlight not originally present but added to bring the reader’s attention to that part of the text. When used in the main prose of a document, it indicates a part of the document that has been highlighted due to its relevance to the user’s current activity.

Usage

I also have some kittens who are visiting me these days. They’re really cute. I think they like my garden! Maybe I should adopt a kitten.

<p>I also have some <mark>kitten</mark>s who are visiting me these days. They&#8217;re really cute. I think they like my garden! Maybe I should adopt a <mark>kitten</mark>.</p>

2.6.16 Tables link

Tables should be used when displaying tabular data. The thead, tfoot and tbody elements enable you to group rows within each a table.

If you use these elements, you must use every element. They should appear in this order: thead, tfoot and tbody, so that browsers can render the foot before receiving all the data. You must use these tags within the table element.

Usage

The Very Best Eggnog
Ingredients Serves 12 Serves 24
Milk 1 quart 2 quart
Cinnamon Sticks 2 1
Vanilla Bean, Split 1 2
Cloves 5 10
Mace 10 blades 20 blades
Egg Yolks 12 24
Cups Sugar 1 ½ cups 3 cups
Dark Rum 1 ½ cups 3 cups
Brandy 1 ½ cups 3 cups
Vanilla 1 tbsp 2 tbsp
Half-and-half or Light Cream 1 quart 2 quart
Freshly grated nutmeg to taste
<table>
    <caption>The Very Best Eggnog</caption>
    <colgroup>
        <col style="width:50%" />
        <col style="width:25%" />
        <col style="width:25%" />
    </colgroup>
    <thead>
        <tr>
            <th scope="col">Ingredients</th>
            <th scope="col">Serves 12</th>
            <th scope="col">Serves 24</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Milk</td>
            <td>1 quart</td>
            <td>2 quart</td>
        </tr>
        <tr>
            <td>Cinnamon Sticks</td>
            <td>2</td>
            <td>1</td>
        </tr>
        <tr>
            <td>Vanilla Bean, Split</td>
            <td>1</td>
            <td>2</td>
        </tr>
        <tr>
            <td>Cloves</td>
            <td>5</td>
            <td>10</td>
        </tr>
        <tr>
            <td>Mace</td>
            <td>10 blades</td>
            <td>20 blades</td>
        </tr>
        <tr>
            <td>Egg Yolks</td>
            <td>12</td>
            <td>24</td>
        </tr>
        <tr>
            <td>Cups Sugar</td>
            <td>1 &frac12; cups</td>
            <td>3 cups</td>
        </tr>
        <tr>
            <td>Dark Rum</td>
            <td>1 &frac12; cups</td>
            <td>3 cups</td>
        </tr>
        <tr>
            <td>Brandy</td>
            <td>1 &frac12; cups</td>
            <td>3 cups</td>
        </tr>
        <tr>
            <td>Vanilla</td>
            <td>1 tbsp</td>
            <td>2 tbsp</td>
        </tr>
        <tr>
            <td>Half-and-half or Light Cream</td>
            <td>1 quart</td>
            <td>2 quart</td>
        </tr>
        <tr>
            <td>Freshly grated nutmeg to taste</td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
</table>