cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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
Loading ..................

Console