cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <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="http://placehold.it/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="http://placehold.it/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Millenials Lay Down Their Investments</a></h1>
          <img src="http://placehold.it/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Things Lucy Maud Montgomery Lied To Me About</a></h1>
          <img src="http://placehold.it/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="http://placehold.it/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">So, You’re Thinking About Seeing A Play?</a></h1>
          <img src="http://placehold.it/100x100" alt=""/>
        </article>
      </li>
      <li>
        <article class="summary">
          <h1><a href="#">Hey Ladies: Take it to Slack</a></h1>
          <img src="http://placehold.it/100x100" alt=""/>
        </article>
      </li>
    </ol>
  </section>
</main>
            
          
!
            
              /* 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;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console