Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                <article id="docs-flex-grid">
  <div class="docs-code-live inner">
    <h1>Foundation 6 – Flex Grid Vertical & Horizontal Alignment </h1>
    <h3 class="subheader">Examples using the new flex-box based grid system</h3>
    <hr/>
    <p>These examples showcase how you can use Foundation 6 to create easily customisazble layouts using the optional Flexbox Grid. This showcases the horizontal and vertical alignment options</p>
      <p>
        <p><strong>Note:</strong>This example uses the stylesheet taken directly off the Foundation 6 example page as of the current date of this example there isn't a direct CSS link to the optional Flex Grid layout</p>
        <br/>
        <h3>Flex Horizontal Alignment</h3>
        <p>Shows how you can use the alignment classes to easily position your content both horizontally and vertically</p>
        <b>Align right</b>
        <p>Right align the elements</p>
        <div class="row align-right align-container">
          <div class="column small-3">Element One</div>
          <div class="column small-3">Element Two</div>
          <div class="column small-3">Element Three</div>
        </div>
        <b>Align center</b>
        <p>Center align the elements

          <div class="row align-center align-container">
            <div class="column small-3">Element One</div>
            <div class="column small-3">Element Two</div>
            <div class="column small-3">Element Three</div>
          </div>
          <b>Align Spaced</b>
          <p>Space out the elements, with even spacing around the elements</p>

          <div class="row align-spaced align-container">
            <div class="column small-3">Element One</div>
            <div class="column small-3">Element Two</div>
            <div class="column small-3">Element Three</div>
          </div>
          <p><a class="button" href="https://foundation.zurb.com/sites/docs/flex-grid.html#column-alignment" target="_blank">Click to view the docs about horizontal alignment</a></p>
          <hr/>
          <h3>Flex Verticalntal Alignment</h3>
          <p>Shows how you can use the vertical alignment classes to position your content vertically. By default flex items sit at the top of their parent, but you can manually set this on an element by element basis</p>
          <b>Align Top</b>
          <p>Default, aligns the items to the top of the parent</p>
          <div class="row align-top align-v-container">
            <div class="column">Element One
              <p>Here is some additional content making me taller</p>
            </div>
            <div class="column">Element Two</div>
            <div class="column">Element Three
              <p>I also have some additional content, I'm stuck to the top!</div>
          </div>
          <b>Align Middle</b>
          <p>Aligns the items to the middle of the parent</p>
          <div class="row align-middle align-v-container">
            <div class="column ">Element One
              <p>Here is some additional content making me taller</p>
            </div>
            <div class="column">Element Two</div>
            <div class="column">Element Three
              <p>I also have some additional content</div>
          </div>
          <b>Align Bottom</b>
          <p>Aligns the items to the bottom of the parent</p>
          <div class="row align-bottom align-v-container">
            <div class="column">Element One


            </div>
            <div class="column">Element Two
              <p>We are stuck to the bottom of the container</p>
            </div>
            <div class="column">Element Three
              <p>I also have some additional content, I'm stuck to the top!</div>
          </div>
          <p>Adding the alignment classes to the parent row will make all of the items inside of it align to the chosen vertical position. You can also specify on individual elements themselves where you want them to align by specifying either align-top,
            align-middle or align-bottom</p>
          <p><a class="button" href="https://foundation.zurb.com/sites/docs/flex-grid.html#vertical-alignment" target="_blank">Find out more about vertical alignment on the docs</a></p>
  </div>
</article>

<p class="p">Demo by Simon Codrington. <a href="http://www.sitepoint.com/foundation-6-the-new-flex-grid" target="_blank">See article</a>.</p>
              
            
!

CSS

              
                body {
  padding: 0 20px;
}

ul {
  margin-left: 20px;
}

.button {
  margin-top: 20px;
}

/* universal elements for the example */

.inner {
  max-width: 1200px;
  margin: auto;
  padding: 20px 15px 20px 0px;
}

/* slight overrides to remove colours and styles added by an external stylesheet */

#docs-flex-grid .docs-code-live .row,
#docs-flex-grid .docs-code-live .column:nth-child(odd),
#docs-flex-grid .docs-code-live .column:nth-child(even) {
  background: transparent;
  border: none;
  font-size: 100%;
}

/* Horizontal Flex alignment example */

.align-container {
  background: #eee!important;
  padding: 15px;
}

.align-container .column:nth-of-type(1) {
  background: #3e9ddd!important;
}

.align-container .column:nth-of-type(2) {
  background: #9b59b6!important;
}

.align-container .column:nth-of-type(3) {
  background: #f39c12!important;
}

/* Vertical flex alignment example */

.align-v-container {
  background: #eee!important;
  padding: 15px 15px;
}

.align-v-container .column:nth-of-type(1) {
  background: #34495e!important;
}

.align-v-container .column:nth-of-type(2) {
  background: #16a085!important;
}

.align-v-container .column:nth-of-type(3) {
  background: #7f8c8d!important;
}

/* Ordering example */

.ordering-container {
  background: #eee!important;
  padding: 15px 15px;
}

.p {
  font-size: 14px;
  text-align: center;
}

.p a {
  text-decoration: underline;
}
              
            
!

JS

              
                $(document).foundation();
              
            
!
999px

Console