Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .grid
  .row
    .cell I am a header
  .row
    .cell.cell-align-right I am also a header (but on the right)
  .row
    .cell.cell-valign-top.cell-100px.cell-nowrap I am 100px wide and not a pixel more
    .cell
      div I am some content
      div I am some content
      div I am some content
      span I am more content I am more content I am more content I am more content
    .cell.cell-1-5.cell-valign-middle Middle (20%)
    .cell.cell-valign-bottom Bottom
  .row
    .cell.cell-align-center I am a centered footer
              
            
!

CSS

              
                // The essential styling
.row {
  box-sizing: border-box;
  display: table;
  table-layout: fixed;
  width: 100%;
}

.cell {
  display: table-cell;
  flex: 1;
  flex-direction: column;
  position: relative;
}

@supports(display: flex) {
  .row {
    display: flex;
  }
  // display: block is needed to allow inline-block content inside a cell, if there is vertical alignment, we need display: flex
  .cell {
    display: block;
  }
  .cell-valign-middle,
  .cell-valign-bottom {
    display: flex;
  }
}

.cell-min {
  width: 1%;
  flex: none auto;
}

.cell-max {
  width: 100%;
  flex: 1 100%;
}

// Beautify this demo
body, html {
  height: 100%;
}

body {
  background: url(http://desktop.freewallpaper4.me/view/original/6507/gold-bokeh.jpg);
  background-size: cover;
  color: white;
  font-family: verdana;
  padding-top: 20px;
}

.row {
  border-collapse: seperate;
  border-spacing: 8px 0;
  padding: 4px;
}

.cell {
  border-radius: 6px;
  background: rgba(#888, 0.85);
  margin-right: 8px;
  padding: 6px;
  
  &.cell-1-5 {
    flex: none;
    width: 20%;
  }

  &.cell-nowrap {
    overflow: hidden;
    white-space: nowrap;
  }

  &.cell-valign-middle {
    vertical-align: middle;
    justify-content: center;
  }

  &.cell-valign-bottom {
    vertical-align: bottom;
    justify-content: flex-end;
  }

  &.cell-align-center {
    text-align: center;
  }

  &.cell-align-right {
    text-align: right;
  }

  &.cell-100px {
    flex: none;
    width: 100px;
    max-width: 100px;
  }
}

              
            
!

JS

              
                /* A flexbox implementation with css tables fallback, when the browser doesn't support the new syntax (2013).

### Flexbox works in ###

- Android 4.4+ (untested)
- IE11
- FF 22+ (required for absolute positioning)
- Chrome 29+

### Table fallback ###

- Android 4.3 and below (untested)
- IE8 - IE10
- iOS 7 and below
- Safari

*/
              
            
!
999px

Console