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

Save Automatically?

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

              
                <main class="container">
  <article class="content">
    <header>
      <h1>Things Lucy Maud Montgomery Lied To Me About</h1>
      <p>By <a href="#">Lucy Sook Duncombe</a> <time>1 hour ago</time> in <a href="#">The Butter</a></p>
    </header>
    <img src="https://via.placeholder.com/800x450"/>
    <p>That after an ugly childhood and gawky adolescence, I would blossom into a legendary beauty, the type of which that would awe strangers and be best described as “lissome” and “shining,” instead of being someone who obsessively watched makeup tutorials on Youtube and yet still manages to go out with one eye made up perfectly and the other one looking like it had been made up by a drunken goat with only one hoof.</p>
    <p>That as an adult woman, I would be judged mostly on the skill of my housekeeping, and people would comment on the cleanliness of my dishcloths and quality of my ironing rather than literally every single other decision I made starting with my clothes and ending somewhere around the way I chose to orient staples in paperwork.</p>
  </article>

  <section class="sidebar">
    <h1>Most popular</h1>

    <ol class="ranked-list">
      <li>
        <article class="summary">
          <h1><a href="#">This Writer’s On Fire: Rachel Eliza Giffiths</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Millenials Lay Down Their Investments</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Things Lucy Maud Montgomery Lied To Me About</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">How To Tell If You Are In A J.R.R. Tolkien Book</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">So, You’re Thinking About Seeing A Play?</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Hey Ladies: Take it to Slack</a></h1>
          <img src="https://via.placeholder.com/100x100" alt=""/>
        </article>
      </li>
    </ol>
  </section>
</main>
              
            
!

CSS

              
                /* Resets */

* {
  margin: 0;
  padding: 0;
}

a {
  color: mediumaquamarine;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body {
  display: grid;
  justify-items: center;
}

/* Container */
.container {
  display: grid;
  grid-gap: 2em;
  /* Show content area _above_ the sidebar area */
  grid-template-areas:
    "content"
    "sidebar";
}

@media (min-width: 60em) {
  .container {
    grid-template-columns: minmax(auto, 50em) minmax(auto, 20em);
    grid-template-areas:
      /* Show content area _next to_ the sidebar area */
      "content sidebar"
  }
}

/* Content */
.content {
  grid-area: content; /* Assign this `div` to the grid area named `content` */
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid lightgrey;
  padding: 0.5em;
}

.content > header {
  margin-bottom: 1em;
}

.content > header h1 {
  margin-bottom: 0.25em;
  font-size: 1.75em;
  line-height: 1;
}

.content > header p {
  font: caption;
  color: grey;
}

.content > header a {
  font-weight: bold;
}

.content > p {
  margin-bottom: 0.5em;
  font-size: 1.125em;
}

.content > img {
  order: -1;
  max-width: 100%;
  margin-bottom: 0.5em;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar; /* Assign this `div` to the grid area named `sidebar` */
}

.sidebar > h1 {
  padding: 1em;
  font: menu;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

/* Ranked List */
.ranked-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  counter-reset: popular;
}

.ranked-list > li {
  display: flex;
  flex: 1 1 33%;
}

/* Summary */
.summary {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  padding: 0.5em;
  min-width: calc(100px + 1em);
}

.summary > h1 {
  font-size: 1.125em;
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
}

.summary > h1::before {
  display: block;
  counter-increment: popular;
  content: counter(popular);
  font-size: 1.75em;
  font-style: italic;
  font-weight: normal;
  color: grey;
}

.summary > h1 a:not(:hover) {
  color: inherit;
}

.summary > img {
  order: -1;
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5em;
}
              
            
!

JS

              
                
              
            
!
999px

Console