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.

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

            
              <h2>Using flex order</h2>
<div class="flex-container">
  <!--Using flex order-->
  <div class="item item-one">
    Item 1
  </div>
  <div class="item item-two">
    Item 2
  </div>
  <div class="item item-three">
    Item 3
  </div>
</div>

<h2>Horizontal align</h2>
<div class="long-list">
  <!--Using flex order-->
  <ul class="no-style align">
    <li>Item 1</li>
    <li>Item 1</li>
    <li>Item 1</li>
    <li>Item 1</li>
  </ul>
</div>

<h2>Centre position</h2>
<div class="back">
  <!--Using flex order-->
  <div class="align">
    <p>Item</p>
  </div>
</div>

<h2>Centre align using flex</h2>
<div class="flex-container full">
  <!--Using flex order-->
  <div class="centre item-one">
    Item 1
  </div>
  <div class="centre item-two">
    Item 2
  </div>
  <div class="centre item-three">
    Item 3
  </div>
</div>

<h2>Using flex grow</h2>
<div class="flex-container">
  <!--Using flex order-->
  <div class="grow item-one">
    Item 1
  </div>
  <div class="grow item-two">
    Item 2
  </div>
  <div class="grow item-three">
    Item 3
  </div>
</div>

<h2>Using flex shrink</h2>
<div class="flex-container">
  <!--Using flex order-->
  <div class="shrink item-one">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. 


  </div>
  <div class="shrink item-two">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.


  </div>
  <div class="shrink item-three">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.


  </div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,800);

$blue: #54b7f8;
$red: #ca1212;
$green: #1c8a11;
$white: #ffffff;
$grey: #dddddd;

.padding-20 {
  padding: 20px;
}

.no-style {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

body {
  font-family: 'Open Sans', sans-serif;
}

// Using flex order
.flex-container {
  display: flex;
  .item {
    width: 33%;
    @extend .padding-20;
    color: $white;
    &.item-one {
      order: 3;
      background: $blue;
    }
    &.item-two {
      order: 2;
      background: $red;
    }
    &.item-three {
      order: 1;
      background: $green;
    }
  }
}

// Horizontal align
.long-list {
  background: $grey;
  .align {
    display: flex;
    justify-content: space-around;
    @extend .padding-20;
  }
}

// Centre position
.back {
  background: $grey;
  .align {
    display: flex;
    justify-content: space-around;
    @extend .padding-20;
  }
}

// Centre align using flex
.flex-container {
  display: flex;
  &.full {
    height: 200px;
    background: $grey;
    .centre {
      height: 100px;
      width: 33%;
      margin: auto;
      color: $white;
      @extend .padding-20;
      &.item-one {
        background: $blue;
      }
      &.item-two {
        background: $red;
      }
      &.item-three {
        background: $green;
      }
    }
  }
}

// Using flex grow
.flex-container {
  display: flex;
  .grow {
    &.item-one {
      flex-grow: 1;
      background: $blue;
      @extend .padding-20;
      color: $white;
    }
    &.item-two {
      flex-grow: 2;
      background: $red;
      @extend .padding-20;
      color: $white;
    }
    &.item-three {
      flex-grow: 3;
      background: $green;
      @extend .padding-20;
      color: $white;
    }
  }
}

// Using flex shrink
.flex-container {
  display: flex;
  .shrink {
    &.item-one {
      flex-shrink: 1;
      background: $blue;
      @extend .padding-20;
      color: $white;
    }
    &.item-two {
      flex-shrink: 1;
      background: $red;
      @extend .padding-20;
      color: $white;
    }
    &.item-three {
      flex-shrink: 10;
      background: $green;
      @extend .padding-20;
      color: $white;
    }
  }
}
            
          
!
999px
🕑 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 ..................

Console