cssAudio - ActiveCSS - 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.

            
              <div class="l-cs">
  <div>
    <div class="component">
      <h2 class="component__title">Component Title</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis ipsa, nam harum sed blanditiis numquam assumenda consequuntur alias laborum aut, officiis repellat sapiente eos corrupti, quam iure vitae incidunt illo!</p>

    </div>
  </div>
  <div>
    <div class="component component--small">
      <h2 class="component__title">Component Title</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et dicta explicabo quibusdam voluptatem porro ea! Eligendi.</p>
    </div>
    <div class="component component--small">
      <h2 class="component__title">Component Title</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et dicta explicabo quibusdam voluptatem porro ea! Eligendi.</p>
    </div>
  </div>
</div>
            
          
!
            
              body {
  line-height: 1.5;
}

.component {
  background: white;
  border: 2px solid #7F7CFF;
  @media (min-width: 1200px) {
    font-size: 1.5em;
  }
}

.component + .component {
  margin-top: 2rem;
}

.component__title {
  font-size: 2em;
  padding: 0.5em 0.75em;
  background: #7F7CFF;
  margin: 0;
}

.component p {
  padding-left: 1.5em;
  padding-right: 1.5em;
  margin: 1.5em 0;
}

// Small variant 
.component--small {
  .component__title {
    font-size: 1em;
    padding-left: 1.5em;
    padding-right: 1.5em;
  }
}

// Grid stuff 
$margin: 1em;

* {
  box-sizing: border-box;
}

body {
  background: #ddd;
}

%l {
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  margin-left: -$margin;
  margin-right: -$margin;
  padding-left: $margin;
  padding-right: $margin;
  > div { 
    margin: $margin;
  }
}

.l-cs {
  @extend %l;
  > div:first-child { 
    display: flex;
    flex-basis: calc(#{percentage(2/3)} - #{$margin * 2}); 
}
  > div:last-child { flex-basis: calc(#{percentage(1/3)} - #{$margin * 2}); }
}
            
          
!
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