cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

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.

            
              <header>
  <hgroup class="Container">
    <h1>Site Title</h1>
    <h2>Donec id elit non mi porta.</h2>
  </hgroup>
</header>

<main class="Container">
  <div class="Grid">
    <section class="Grid-cell">
      <h2>Heading</h2>
      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
      <a href="#">View details &raquo;</a>
    </section>
    <section class="Grid-cell">
      <h2>Heading</h2>
      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
      <a href="#">View details &raquo;</a>
   </section>
    <section class="Grid-cell">
      <h2>Heading</h2>
      <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
      <a href="#">View details &raquo;</a>
    </section>
  </div>
</main>

            
          
!
            
              :root { --gutter: 1.5em; }
@media (min-width: 30em) {
  :root { --gutter: 2em; }
}
@media (min-width: 48em) {
  :root { --gutter: 3em; }
}

.Container {
  margin: 0 auto;
  max-width: 60em;
  padding: var(--gutter);
}

.Grid {
  --gutterNegative: calc(-1 * var(--gutter));
  margin-left: var(--gutterNegative);
  margin-top: var(--gutterNegative);
}

.Grid-cell {
  margin-left: var(--gutter);
  margin-top: var(--gutter);
}

@media (min-width: 48em) {
  .Grid {
    display: flex;
  }
  .Grid-cell {
    flex: 1;
  }
}


/* The styles below aren't relevant to the demo. */

* {
  font: inherit;
  margin: 0;
  padding: 0;
}

body {
  color: #333;
  font: 1em/1.25 'Helvetica Neue', sans-serif;
}

header {
  background-color: hsl(30, 15%, 95%);
}

h1 {
  font-size: 3em;
  line-height: 1;
  margin: .25em 0;
}

@media (min-width: 48em) {
  h1 {
    font-size: 4em;
  }
}

h2 {
  font-size: 1.5em;
}

p {
  margin: 1em 0;
}

a {
  color: hsl(165, 60%, 40%);
}
            
          
!
            
              function supportsCSSCustomProperties() {
  var div = document.createElement('div');
  div.style.setProperty('--width', '1%');
  return div.style.getPropertyValue('--width') == '1%';
}

if (!supportsCSSCustomProperties()) {
  alert('Sorry! Your browser does not support CSS Custom Properties.');
}

            
          
!
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