Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html>
<head>
  <title>Typography Blog</title>
  <link rel="stylesheet" type="text/css" href="styles/reset.css">
  <link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>

  <!-- Header -->
  <nav class="header">
    <ul>
      <li><a class="home" href="#top">FAVORITE FONTS</a></li>
      <li><a class="pagelink" href="#serif">SERIF</a></li>
      <li><a class="pagelink" href="#sans">SANS-SERIF</a></li>
      <li><a class="pagelink" href="#mono">MONOSPACED</a></li>
    </ul>
  </nav>

  <!-- Banner Section -->
  <div class="banner">
    <h1>Typography</h1>
      <p>While typography has been practiced for many centuries, digital font design is a relatively new discipline. There are some great examples of old-school fonts (also called typefaces) which have been adapted for use on digital displays. However, I would like to highlight a few of my favorite fonts that were created with screens in mind.</p>
  </div>

  <!-- Serif Section -->
  <div id="serif">

    <!-- Editorial Section - Serif -->
    <div class="editorial">
      <h2>Serif</h2>
      <p>Serifs are the small features at the end of strokes within letters. These features are <strong>functional as well as decorative</strong>. Serif fonts are widely used for body text (eg. articles) because they are considered easier to read than sans-serif fonts in print.</p>
      <p><em>Serif fonts can often create a feeling of traditionalism and antiquity, due to their common use in printed materials for many years.</em></p>
    </div>

    <!-- Font Card - Serif -->
    <div class="font-card garamond">
      <h2>Garamond</h2>
      <p class="creator">by Claude Garamond (16th Century)</p>
      <div class="garamond">
        <span class="sample">
          <h2>Bold</h2>
          <span class="bold text">Abc</span>
        </span>
        <span class="sample">
          <h2>Regular</h2>
          <span class="regular text">Abc</span>
        </span>
        <span class="sample">
          <h2>Italic</h2>
          <span class="italic text">Abc</span>
        </span>
      </div>
    </div>
  </div>

  <!-- Sans-Serif Section -->
  <div id="sans">

    <!-- Editorial Section - Sans-Serif -->
    <div class="editorial">
      <h2>Sans-Serif</h2>
      <p>Sans-Serif ("without serif") describes fonts with characters which lack flourishes at the ends of the strokes. Sans-serif fonts have become the most prevalent for display of text on computer screens, as on lower-resolution digital displays, fine details like serifs may disappear or appear too large.</p>
      <p><em>Sans-serif fonts are often used to project an image of simplicity, modernity or minimalism.</em></p>
    </div>

    <!-- Font Card - Sans-Serif -->
    <div class="font-card">
      <h2>Helvetica</h2>
      <p class="creator">by Max Miedinger & Eduard Hoffman (1957)</p>
      <div class="helvetica">
        <span class="sample">
          <h2>Bold</h2>
          <span class="bold text">Abc</span>
        </span>
        <span class="sample">
          <h2>Regular</h2>
          <span class="regular text">Abc</span>
        </span>
      </div>
    </div>
  </div>

  <!-- Monospaced Section -->
  <div id="mono">

    <!-- Editorial - Monospaced -->
    <div class="editorial">
      <h2>Monospaced</h2>
      <p>A monospaced font's characters each occupy the same amount of horizontal space. This contrasts with most fonts, where the letters and spacings have different widths. For example, the two high-use letters "I" and "E" do not need the same footprint. The first monospaced Western typefaces were designed for typewriters.</p>
      <p><em>Many text editors (like those used to write computer code) use monospaced fonts, which aid in distinguishing between potentially similar characters (like "l" and "1") and in counting the number of characters in a line.</em></p>
    </div>

    <!-- Font Card - Monospaced -->
    <div class="font-card">
      <h2>Space Mono</h2>
      <p class="creator">by Colophon Foundry (2016)</p>
      <div class="space">
        <span class="sample">
          <h2>Bold</h2>
          <span class="bold text">Abc</span>
        </span>
        <span class="sample">
          <h2>Regular</h2>
          <span class="regular text">Abc</span>
        </span>
      </div>
    </div>
  </div>
</body>
</html>

              
            
!

CSS

              
                /* Universal Styles */
/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Space Mono'), local('SpaceMono-Regular'), url(https://fonts.gstatic.com/s/spacemono/v3/i7dPIFZifjKcF5UAWdDRYEF8RXi4EwQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  src: local('Space Mono Bold'), local('SpaceMono-Bold'), url(https://fonts.gstatic.com/s/spacemono/v3/i7dMIFZifjKcF5UAWdDRaPpZUFWaHi6WZ3Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Glegoo";
  src: url(../fonts/Glegoo-Regular.ttf) format('truetype');
}

html {
  font-size: 16px;
  font-family: "Arial", sans-serif;
}

body {
  background-color: #F2F2F2;
}

h1 {
  color: white;
  font-size: 28px;
  font-family: Georgia;
  text-transform: uppercase;
  text-align: center;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 2.5;
  font-family: Georgia;
  word-spacing: 0.05em;
  letter-spacing: 0.02em;
}

a {
  text-decoration: none;
}

p {
  margin: 16px 0;
  font-family: Helvetica;
}

strong {
  font-weight: bold;
}

#serif, /* Offset linked sections to account for header. */
#sans,
#mono {
  padding-top: 77px;
  margin-top: -77px;
}

/* Header */

.header {
  font-family: "Arial", sans-serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  background-color: #fff;
  position: fixed;
  top: 0;
  width: 100%;
}

.header li {
  display: inline-block;
}

.header a {
  display: block;
  color: #4A4A4A;
  padding: 30px 20px;
}

a.home {
  color: #4D00FF;
}


/* Banner Section */

.banner {
  background-color: #4D00FF;
  padding: 100px 0;
  margin-top: 77px;
  text-align: center;
}

.banner p {
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 10px;
  color: #ffffff;
  font-weight: bold;
  font-family: Glegoo;
  font-size: 20px;
  line-height: 1.4;
}

/* Editorial Sections */

.editorial {
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  color: #4C4C4C;
}

/* Font Card Sections */

.font-card {
  background-color: #ffffff;
  margin: 50px 0;
  padding: 20px 50px;
}

.font-card .creator {
  font-size: 20px;
  line-height: 1.25;
  font-style: italic;
}

.sample {
  display: inline-block;
  padding: 0 20px;
  margin: 20px;
}

.sample h2 {
  line-height: 1.5;
}

.sample .text {
  color: #4D00FF;
  font-size: 100px;
}

/* Add styles for the Garamond font here */
.garamond .sample .text {
  font-family: Garamond, serif;
}

/* Add styles for the Helvetica font here */
.helvetica .sample .text {
  font-family: Helvetica, sans-serif;
}

/* Add styles for the Space Mono font here */
.space .sample .text {
  font-family: 'Space Mono', monospace;
}

.bold {
  font-weight: 900;
}

.regular {
  font-weight: normal;
}

.italic {
  font-weight: normal;
  font-style: italic;
}

/* Media Queries */

@media only screen and (max-width: 535px) {
  .header {
    font-size: 14px;
  }

  .header a {
    padding: 30px 20px;
  }

  a.home {
    display: none;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console