Typography

Typography in Foundation 5 is meant to make your life easier by providing clean, attractive, simple default styles for all of the most basic typographical elements.


Headers

Foundation includes styles for all of the header elements that are balanced and based on a modular scale (though modular-scale is not a dependency of Foundation).

HTML

<h1>h1. This is a very large header.</h1> <h2>h2. This is a large header.</h2> <h3>h3. This is a medium header.</h3> <h4>h4. This is a moderate header.</h4> <h5>h5. This is a small header.</h5> <h6>h6. This is a tiny header.</h6>

Rendered HTML

h1. This is a very large header.

h2. This is a large header.

h3. This is a medium header.

h4. This is a moderate header.

h5. This is a small header.
h6. This is a tiny header.

Subheaders

Lighten up your headers by adding a class of .subheader to any header element.

HTML

<h1 class="subheader">h1.subheader</h1> <h2 class="subheader">h2.subheader</h2> <h3 class="subheader">h3.subheader</h3> <h4 class="subheader">h4.subheader</h4> <h5 class="subheader">h5.subheader</h5> <h6 class="subheader">h6.subheader</h6>

Rendered HTML

h1.subheader

h2.subheader

h3.subheader

h4.subheader

h5.subheader
h6.subheader

Small Header Segments

By inserting a small element into a header Foundation will scale the header font size down for an inline element, allowing you to use this for subtitles or other secondary header text.

HTML

<h1>h1. <small>Small segment header.</small></h1> <h2>h2. <small>Small segment header.</small></h2> <h3>h3. <small>Small segment header.</small></h3> <h4>h4. <small>Small segment header.</small></h4> <h5>h5. <small>Small segment header.</small></h5> <h6>h6. <small>Small segment header.</small></h6>

Rendered HTML

h1. Small segment header.

h2. Small segment header.

h3. Small segment header.

h4. Small segment header.

h5. Small segment header.
h6. Small segment header.

Paragraphs

This is a paragraph. Paragraphs are preset with a font size, line height and spacing to match the overall vertical rhythm. To show what a paragraph looks like this needs a little more content -- so, did you know that there are storms occurring on Jupiter that are larger than the Earth? Pretty cool. Wrap strong around type to make it bold! You can also use em to italicize your words.

HTML

<p>This is a paragraph. Paragraphs are preset with a font size, line height and spacing to match the overall vertical rhythm. To show what a paragraph looks like this needs a little more content so, did you know that there are storms occurring on Jupiter that are larger than the Earth? Pretty cool. Wrap strong around type to <strong>make it bold!</strong>. You can also use em to <em>italicize your words</em>.</p>

Need to align text? We made some slick utility classes to help you out.

Links are very standard, and the color is preset to the Foundation primary color.

HTML

<p>Links are very standard, and the <a href="http://www.youtube.com/watch?v=zT2aVoUkSDg">color is preset</a> to the Foundation primary color.</p>

Lists

Lists are helpful for, well, lists of things. Didn't see that coming did you! There are baked-in styles for a number of different unordered list styles, as well as ordered and definition lists.

HTML

<ul class="disc"> <li>List item with a much longer description or more content.</li> <li>List item</li> <li>List item <ul> <li>Nested list item</li> <li>Nested list item</li> <li>Nested list item</li> </ul> </li> <li>List item</li> <li>List item</li> <li>List item</li> </ul>

Rendered HTML

  • List item with a much longer description or more content.
  • List item
  • List item
    • Nested list item
    • Nested list item
    • Nested list item
  • List item
  • List item
  • List item

HTML

<ul class="circle"> <li>List item with a much longer description or more content.</li> <li>List item</li> <li>List item <ul> <li>Nested List Item</li> <li>Nested List Item</li> <li>Nested List Item</li> </ul> </li> <li>List item</li> <li>List item</li> <li>List item</li> </ul>

Rendered HTML

  • List item with a much longer description or more content.
  • List item
  • List item
    • Nested List Item
    • Nested List Item
    • Nested List Item
  • List item
  • List item
  • List item

HTML

<ul class="square"> <li>List item with a much longer description or more content.</li> <li>List item</li> <li>List item <ul> <li>Nested List Item</li> <li>Nested List Item</li> <li>Nested List Item</li> </ul> </li> <li>List item</li> <li>List item</li> <li>List item</li> </ul>

Rendered HTML

  • List item with a much longer description or more content.
  • List item
  • List item
    • Nested List Item
    • Nested List Item
    • Nested List Item
  • List item
  • List item
  • List item

HTML

<ul class="no-bullet"> <li>List item with a much longer description or more content.</li> <li>List item</li> <li>List item <ul> <li>Nested List Item</li> <li>Nested List Item</li> <li>Nested List Item</li> </ul> </li> <li>List item</li> <li>List item</li> <li>List item</li> </ul>

Rendered HTML

  • List item with a much longer description or more content.
  • List item
  • List item
    • Nested List Item
    • Nested List Item
    • Nested List Item
  • List item
  • List item
  • List item

HTML

<ol> <li>List item with a much longer description or more content.</li> <li>List item</li> <li>List item <ol> <li>Nested List Item</li> <li>Nested List Item</li> <li>Nested List Item</li> </ol> </li> <li>List item</li> <li>List item</li> <li>List item</li> </ol>

Rendered HTML

  1. List item with a much longer description or more content.
  2. List item
  3. List item
    1. Nested List Item
    2. Nested List Item
    3. Nested List Item
  4. List item
  5. List item
  6. List item

HTML

<dl> <dt>Definition Title</dt> <dd>Definition Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam id dolor id nibh ultricies vehicula ut id elit.</dd> </dl>

Rendered HTML

Definition Title
Definition Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam id dolor id nibh ultricies vehicula ut id elit.

Blockquotes

Sometimes other people say smart things, and you may want to mention that through a blockquote callout. We've got you covered.

HTML

<blockquote>Those people who think they know everything are a great annoyance to those of us who do.<cite>Isaac Asimov</cite></blockquote>

Rendered HTML

Those people who think they know everything are a great annoyance to those of us who do.Isaac Asimov

V-Cards

Here's a handy microformat-friendly list to address all your needs.

HTML

<ul class="vcard"> <li class="fn">Gaius Baltar</li> <li class="street-address">123 Colonial Ave.</li> <li class="locality">Caprica City</li> <li><span class="state">Caprica</span>, <span class="zip">12345</span></li> <li class="email"><a href="#">g.baltar@example.com</a></li> </ul>

Rendered HTML


Foundation includes print styles developed by HTML5 Boilerplate to give you some basic print-specific styles. These are activated when you print through a media query. It includes:

  • Clearing out backgrounds, box shadows and text shadows
  • Appending link URLs after the anchor text
  • Bordering blockquotes and pre elements
  • Page cleanup and window minimization

On top of that, Foundation includes a couple of simple visibility classes you can use to control elements printing, or not printing. See Print Visibility for more information.


Available SCSS Variables

We've got a ton of variables for you to use to customize your typography.

SCSS

$include-html-type-classes: $include-html-classes; // We use these to control header font styles $header-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; $header-font-weight: bold; $header-font-style: normal; $header-font-color: #222; $header-line-height: 1.4; $header-top-margin: .2rem; $header-bottom-margin: .5rem; $header-text-rendering: optimizeLegibility; // We use these to control header font sizes $h1-font-size: rem-calc(44); $h2-font-size: rem-calc(37); $h3-font-size: rem-calc(27); $h4-font-size: rem-calc(23); $h5-font-size: rem-calc(18); $h6-font-size: 1rem; // These control how subheaders are styled $subheader-line-height: 1.4; $subheader-font-color: scale-color($header-font-color, $lightness: 35%); $subheader-font-weight: 300; $subheader-top-margin: .2rem; $subheader-bottom-margin: .5rem; // A general small styling $small-font-size: 60%; $small-font-color: scale-color($header-font-color, $lightness: 35%); // We use these to style paragraphs $paragraph-font-family: inherit; $paragraph-font-weight: normal; $paragraph-font-size: 1rem; $paragraph-line-height: 1.6; $paragraph-margin-bottom: rem-calc(20); $paragraph-aside-font-size: rem-calc(14); $paragraph-aside-line-height: 1.35; $paragraph-aside-font-style: italic; $paragraph-text-rendering: optimizeLegibility; // We use these to style code tags $code-color: scale-color($alert-color, $lightness: -27%); $code-font-family: Consolas, Liberation Mono, Courier, monospace; $code-font-weight: bold; // We use these to style anchors $anchor-text-decoration: none; $anchor-font-color: $primary-color; $anchor-font-color-hover: scale-color($primary-color, $lightness: -14%); // We use these to style the hr element $hr-border-width: 1px; $hr-border-style: solid; $hr-border-color: #ddd; $hr-margin: rem-calc(20); // We use these to style lists $list-style-position: outside; $list-side-margin: 0; $list-nested-margin: rem-calc(20); $definition-list-header-weight: bold; $definition-list-header-margin-bottom: .3rem; $definition-list-margin-bottom: rem-calc(12); // We use these to style blockquotes $blockquote-font-color: scale-color($header-font-color, $lightness: 35%); $blockquote-padding: rem-calc(9 20 0 19); $blockquote-border: 1px solid #ddd; $blockquote-cite-font-size: rem-calc(13); $blockquote-cite-font-color: scale-color($header-font-color, $lightness: 23%); $blockquote-cite-link-color: $blockquote-cite-font-color; // Acronym styles $acronym-underline: 1px dotted #ddd; // We use these to control padding and margin $microformat-padding: rem-calc(10 12); $microformat-margin: rem-calc(0 0 20 0); // We use these to control the border styles $microformat-border-width: 1px; $microformat-border-style: solid; $microformat-border-color: #ddd; // We use these to control full name font styles $microformat-fullname-font-weight: bold; $microformat-fullname-font-size: rem-calc(15); // We use this to control the summary font styles $microformat-summary-font-weight: bold; // We use this to control abbr padding $microformat-abbr-padding: rem-calc(0 1); // We use this to control abbr font styles $microformat-abbr-font-weight: bold; $microformat-abbr-font-decoration: none;

Sass Errors?

If the default "foundation" import was commented out, then make sure you import this file:

SCSS

@import "foundation/components/type";




Building Blocks Using Typography


Want more? Check out all the hot Building Blocks ⇨

Stay on top of what’s happening in responsive design.

Sign up to receive monthly Responsive Reading highlights. Read Last Month's Edition »