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

              
                <header class="site-header">
  <div class="inner-column">
    <div class="masthead">
      <nav class="site-menu">
        <a href="#">LOGO</a>
        <a href="#">Some page</a>
        <a href="#">"Masthead"</a>
      </nav>

      <nav class="user-menu">
        <a href="#">sign-in</a>
      </nav>
    </div>
  </div>
</header>

<main>
  <section class="landing">
    <div class="inner-column">
      <!-- BAD CLASS NAME. SEND HELP -->
      <div class="landing-module">
        <picture class="landing-image">
          <img src="https://peprojects.dev/images/square.jpg" />
        </picture>
        <div class="landing-text">
          <h1 class="attention-voice">Hello! this is a "diptych"</h1>
          <p class="neutral-voice">
            You can call it whatever you want. It's a module that has an image and some support
            text. On the smaller screen it works nicely to stack. On a larger screen, it fits
            side by side.
          </p>
        </div>
      </div>
    </div>
  </section>

  <section class="call-to-action">
    <div class="inner-column">
      <h1 class="attention-voice">This module is a "call to action"</h1>
      <p class="neutral-voice">
        These aren't names you should memorize. We're just making them up. Sometimes things get
        called something so many times that it sticks. This is a pretty common pattern.
      </p>

      <a class="solid-button" href="#">Here's the action!</a>
    </div>
  </section>

  <!-- BAD CLASS NAMES. HELP -->
  <section class="articles">
    <div class="inner-column">
      <div class="articles-heading">
        <h1 class="attention-voice">This is an "Article Grid" module.</h1>
        <p class="neutral-voice">
          Again, we totally just made that up. It's a box with boxes in it.
        </p>
      </div>

      <div class="articles-grid">
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is an article card</h2>
            <p class="neutral-voice">It's basically a mini call to action right?</p>
          </div>
          <a class="solid-button" href="#">act!</a>
        </div>
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is the title of an article card</h2>
            <p class="neutral-voice">
              Here's a little info to help you understand if this is an article you want to
              read.
            </p>
          </div>
          <a class="solid-button" href="#">Read More!</a>
        </div>
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is the title of an article card</h2>
            <p class="neutral-voice">
              Here's a little info to help you understand if this is an article you want to
              read.
            </p>
          </div>
          <a class="solid-button" href="#">Read More!</a>
        </div>
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is the title of an article card</h2>
            <p class="neutral-voice">
              Here's a little info to help you understand if this is an article you want to
              read.
            </p>
          </div>
          <a class="solid-button" href="#">Read More!</a>
        </div>
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is the title of an article card</h2>
            <p class="neutral-voice">
              Here's a little info to help you understand if this is an article you want to
              read.
            </p>
          </div>
          <a class="solid-button" href="#">Read More!</a>
        </div>
        <div class="article-card">
          <div class="article-card-text">
            <h2 class="stern-voice">This is the title of an article card</h2>
            <p class="neutral-voice">
              Here's a little info to help you understand if this is an article you want to
              read.
            </p>
          </div>
          <a class="solid-button" href="#">Read More!</a>
        </div>
      </div>
    </div>
  </section>

  <section class="call-to-action bg-salmon">
    <div class="inner-column">
      <h1 class="attention-voice">This module is a "call to action"</h1>
      <p class="neutral-voice">
        These aren't names you should memorize. We're just making them up. Sometimes things get
        called something so many times that it sticks. This is a pretty common pattern.
      </p>

      <a class="solid-button" href="#">Here's the action!</a>
    </div>
  </section>
</main>

<footer class="site-footer">
  <div class="inner-column">
    <div class="site-footer-text">
      <h1 class="stern-voice">This is the site footer and it has a "site-map" module in it.</h1>

      <p class="neutral-voice">Pretty standard type of thing, right?</p>
    </div>

    <div class="site-map">
      <nav class="site-map-nav">
        <a href="#">LOGO</a>
        <a href="#">Some page</a>
        <a href="#">Some other page</a>
      </nav>
      <nav class="site-map-nav">
        <a href="#">Sign-in</a>
      </nav>
      <nav class="site-map-nav">
        <a href="#">Legal thing a</a>
        <a href="#">Legal thing b</a>
      </nav>
      <nav class="site-map-nav">
        <a href="#">Social thing a</a>
        <a href="#">Social thing b</a>
        <a href="#">Social thing c</a>
        <a href="#">Social thing d</a>
      </nav>
    </div>
  </div>
</footer>
              
            
!

CSS

              
                /* CSS reset and css setup applied in codepen settings*/

h1 {
  line-height: 1.2;
}

p {
  line-height: 1.5;
}

.loud-voice {
  font-family: Helvetica, sans-serif;
  font-size: 45px;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.attention-voice {
  font-family: Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.stern-voice {
  font-family: Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.neutral-voice {
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  max-width: 78ch;

  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.loud-voice + .neutral-voice {
  margin-top: 20px;
}

.attention-voice + .neutral-voice {
  margin-top: 20px;
}

.stern-voice + .neutral-voice {
  margin-top: 20px;
}

.inner-column {
  max-width: 1000px;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.site-header {
  padding-bottom: 0px;
  background-color: #acd9bd;
}

section,
footer {
  padding-top: 50px;
  padding-bottom: 50px;
  /* for display */
}

.masthead nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;

  /* for display */
  border: 3px solid black;
  padding: 10px;
}

nav a {
  font-family: Helvetica, sans-serif;
  color: black;
  text-decoration: underline;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.landing {
  background-color: #acdee7;
}

.landing-module {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-image {
  max-width: 500px;

  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.landing-image img {
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.landing-text {
  /* for display */
  border: 3px solid black;
  padding: 10px;

  padding-top: 20px;
  padding-bottom: 20px;
}

.solid-button {
  display: inline-block;
  font-family: Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 2px;

  color: #ffffff;
  background-color: black;
  padding: 14px 15px;
}

.neutral-voice + .solid-button {
  margin-top: 20px;
}

.article-card-text + .solid-button {
  margin-top: 20px;
}

.call-to-action {
  background-color: #db9dc8;
}

.articles {
  background-color: #fccb98;
}

.articles-heading {
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.articles-heading + .articles-grid {
  margin-top: 70px;
}

.article-card {
  width: 100%;
  /* for display */
  border: 3px solid black;
  padding: 10px;
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-gap: 20px;
  justify-items: center;
}

.bg-salmon {
  background-color: #ff9197;
}

.site-footer {
  background-color: #fbf0e4;
}

.site-footer-text {
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

.site-map {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}

.site-footer-text + .site-map {
  margin-top: 35px;
}

.site-map-nav {
  /* for display */
  border: 3px solid black;
  padding: 10px;
}

@media (min-width: 600px) {
  .masthead {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 650px) {
  .landing-module {
    flex-direction: row-reverse;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console