Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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>
  <div class="box most_read">
    <h2>Most read posts</h2>
    <ol>
      <li><a href="">Lorem ipsum dolor sit amet</a> <span class="views">24,783</span></li>
      <li><a href="">Consectetuer adipiscing elit</a> <span class="views">5,623</span></li>
      <li><a href="">Aliquam tincidunt mauris eu risus</a> <span class="views">3,628</span></li>
      <li><a href="">Vestibulum auctor dapibus neque</a> <span class="views">2,137</span></li>
      <li><a href="">Nunc dignissim risus id metus</a> <span class="views">1,623</span></li>
    </ol>
  </div>
  <div class="box recommended">
    <h2>Recommended</h2>
    <ul>
      <li>
        <a href="">¡Cras ornare tristique elit!</a>
        <br>
        <a href="">cerosetenta</a>
      </li>
      <li>
        <a href="">Vivamus vestibulum nulla nec ante</a>
        <br>
        <a href="">Lina Pinto</a>
      </li>
      <li>
        <a href="">Imelda Daza: “Praesent placerat risus quis eros”</a>
        <br>
        <a href="">Estefanía Avella Bermúdez</a>
      </li>
      <li>
        <a href="">Christiana Figueres, Fusce pellentesque suscipit nibh</a>
        <br>
        <a href="">Hernán D. Caro*</a>
      </li>
    </ul>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=1)">
      <a href="">
        <h2>Fusce lobortis lorem at ipsum semper sagittis</h2>
        <div class="meta">
          <span class="genre">Crónica</span><br>
          <span class="author">Miguel Botero Echeverri</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=2)">
      <a href="">
        <h2>Integer vitae libero ac risus egestas placerat</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Sara Cely</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=3)">
      <a href="">
        <h2>Vestibulum commodo felis quis tortor</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Juanita Vélez</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article big-article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=4)">
      <a href="">
        <h2>[Ruinas en Bogotá]: Ut aliquam sollicitudin leo</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Daniela Bohorquez</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article big-article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=5)">
      <a href="">
        <h2>[EN VITRINA]: Cras iaculis ultricies nulla</h2>
        <div class="meta">
          <span class="genre">Entrevista</span><br>
          <span class="author">Laura Galindo M.</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=6)">
      <a href="">
        <h2>Donec quis dui at dolor tempor interdum</h2>
        <div class="meta">
          <span class="genre">Opinión</span><br>
          <span class="author">Daniel Poveda</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=7)">
      <a href="">
        <h2>Vivamus molestie gravida turpis</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Estefanía Avella Bermúdez</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=1)">
      <a href="">
        <h2>Fusce lobortis lorem at ipsum semper sagittis</h2>
        <div class="meta">
          <span class="genre">Crónica</span><br>
          <span class="author">Miguel Botero Echeverri</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=2)">
      <a href="">
        <h2>Integer vitae libero ac risus egestas placerat</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Sara Cely</span>
        </div>
      </a>
    </article>
  </div>
  <div class="box article">
    <article style="background-image: url(https://placeimg.com/640/480/any/grayscale?a=3)">
      <a href="">
        <h2>Vestibulum commodo felis quis tortor</h2>
        <div class="meta">
          <span class="genre">Reportaje</span><br>
          <span class="author">Juanita Vélez</span>
        </div>
      </a>
    </article>
  </div>
</main>
              
            
!

CSS

              
                @supports (display: grid) {
  main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-auto-rows: minmax(max-content, 1fr);
    grid-auto-flow: dense;
    align-items: stretch;
  }

  .most_read,
  .recommended,
  .big-article {
    grid-row: span 2;
  }

  @media screen and (min-width: 1200px) {
    main {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .article {
      grid-column: span 2;
    }
    .big-article {
      grid-column: span 4;
    }
  }
}

@supports not (display: grid) {
  .most_read,
  .recommended,
  .article {
    box-sizing: border-box;
    float: left;
    max-width: 320px;
  }
}

.most_read,
.recommended {
  display: block;
  padding: 1em;
}

article {
  height: 100%;
}
.article a {
  box-sizing: border-box;
  display: block;
  height: 100%;
  padding: 1em;
}

/* non-layout styles */
a {
  text-decoration: none;
}
.most_read {
  background-color: beige;
  color: crimson
}
.recommended {
  background-color: crimson;
  color: beige;
}
.most_read li,
.recommended li {
  border-bottom: 1px solid crimson;
  padding: 8px 0;
}
.recommended li {
  border-color: beige;
}
.most_read a {
  color: black;
}
.recommended a {
  color: white;
}

article {
  background-size: cover;
}
.article a {
  background: rgba(0,0,0,0.25);
  color: cyan;
}
.article h2 {
  color: white;
}
              
            
!

JS

              
                
              
            
!
999px

Console