css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

                <div class="grid">
    <header><h1>This is CSS Grid Layout!</h1></header>

    <div class="content">

      <p>Grid Layout gives us a method of creating structures that are not unlike using “tables for layout”. However, being described in CSS and not in HTML they allow us to create layouts that can be redefined using Media Queries and adapt to different contexts.</p>

      <p>Grid Layout lets us properly separate the order of elements in the source from their visual presentation. As a designer this means you are free to change the location of page elements as is best for your layout at different breakpoints and not need to compromise a sensible structred document for your responsive design.</p>

      <p>It’s very easy to make grid adapt to the available space. With each element having an area on the grid, things are not in risk of overlapping due to text size change, more content than expected or small viewports.</p>

      <p>Unlike with an HTML table-based layout, you can layer items on the grid. So one item can overlap another if required.</p>


        <li><a href="http://www.w3.org/TR/css-grid-1">CSS Grid Spec</a></li>
        <li><a href="http://drafts.csswg.org/css-grid/">CSS Grid latest Editor's Draft</a></li>
        <li><a href="http://gridbyexample.com">Grid by Example</a></li>
        <li><a href="https://igalia.github.io/css-grid-layout/">Examples from Igalia</a></li>


      <p>CSS Grid Layout is coming soon! Take a look at the examples using <a href="http://gridbyexample.com/browsers/">a supporting browser</a>.</p>

      <p>Talk to me about Grid on <a href="https://twitter.com/rachelandrew">Twitter</a>!</p>

                  .grid > * {
      padding: 10px;

    .grid {
      margin: 20px auto 0 auto;
      max-width: 960px;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      grid-template-rows: repeat(3, auto);

    header {
      background-color: #efefef;
      grid-column: 1 / 6;
      grid-row: 1;

    .content {
      grid-column: 2 / 5;
      grid-row: 2;

    nav { 
      grid-column: 1 / 2;
      grid-row: 2;
      background-color: #ccc;

    aside {
      grid-column: 5;
      grid-row: 2;
      background-color: #ccc;

    footer {
      grid-column: 1 / 6;
      grid-row: 3;
      background-color: #efefef;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................