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.

            
              <p>Key</p>
<ul class="no-bullet">
  <li><span class="box blue"></span> Content area</li>
  <li><span class="box gray"></span> Gutter (padding)</li>
  <li><span class="box black"></span> Column (demo border)</li>
</ul>

<p>Vertical alignment can be applied to a flex parent—which will align all the children automatically—or to a flex child, which will align only that element.</p>

<p>Stretch alignment is the default. To set parent alignment, use these classes:</p>

<code>.align-top</code>
<code>.align-middle</code>
<code>.align-bottom</code>
<code>.align-stretch</code>

<p>By default, flexbox columns will be equal height. So we made one 200px tall and all it's siblings will also be 200px tall. Nice!</p>

<div class="row">
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT 200px tall</span></div>
</div>

<p>Using the vertical alignment classes will override this and make the sibling columns height auto (does not affect the tallest column that is set to 200px).</p>

<br /><br />

<p><code>.align-middle</code></p>

<div class="row align-middle">
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT 200px tall</span></div>
</div>

<p><code>.align-top</code></p>

<div class="row align-top">
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT 200px tall</span></div>
</div>

<p><code>.align-bottom</code></p>

<div class="row align-bottom">
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT 200px tall</span></div>
</div>

<p><code>.align-stretch</code></p>

<div class="row align-stretch">
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT</span></div>
  <div class="column"><span>CONTENT 200px tall</span></div>
</div>

            
          
!
            
              // demo styles
$primary-color: #1779ba;
$secondary-color: #767676;
$light-gray: #e6e6e6;
$success-color: #3adb76;

body {
  padding: 2rem;
}

.row {
  background: $light-gray;
  margin-bottom: 1rem;
}

.column,
.columns {
  background: $secondary-color;
  border: 5px solid black;
  display: flex;
  
  &:nth-child(4) {
    height: 200px;
  }
  
  span {
    background: $primary-color;
    display: block;
    text-align: center;
    width: 100%;
  }
  
  > .row {
    .column,
    .columns {
      background: $success-color;
      border: 1px solid black;

      span {
        background: darken($success-color, 30%);
        display: block;
        text-align: center;
        width: 100%;
      }
    }
  }
}

.callout {
  background: $primary-color;
  text-align: center;
}

.box {
  height: 20px;
  width: 20px;
  display: inline-block;
  
  &.blue {
    background: $primary-color;
  }
  
  &.gray {
    background: $secondary-color;
  }
  
  &.black {
    background: #000;
  }
}
            
          
!
999px
Loading ..................

Console