css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Practical CSS Flexbox usage</h1>

<h2>Equal height columns or blocks</h2>

<div class="container">

  <div class="equal-height-columns">
    <div class="col">
      <p>Mauris sed libero. Suspendisse facilisis nulla in lacinia laoreet, lorem velit accumsan velit vel mattis libero nisl et sem. Proin interdum maecenas massa turpis sagittis in, interdum non lobortis vitae massa. Quisque purus lectus, posuere eget imperdiet nec sodales id arcu. Vestibulum elit pede dictum eu, viverra non tincidunt eu ligula.</p>
    </div>
    <div class="col">
      <p>Mauris sed libero. Suspendisse facilisis nulla in lacinia laoreet, lorem velit accumsan velit vel mattis libero nisl et sem. Proin interdum maecenas massa turpis sagittis in, interdum non lobortis vitae massa.</p>
    </div>
    <div class="col">
      <p>Mauris sed libero. Suspendisse facilisis nulla in lacinia laoreet, lorem velit accumsan velit vel mattis libero nisl et sem.</p>
    </div>
  </div>
  
</div>

<h2>Align two items left and right</h2>

<div class="container">

  <div class="align-items-left-right">
    <a href="">Align me left</a>
    <a href="">Align me right</a>
  </div>

</div>

<h2>Vertical and horizontal centering</h2>

<div class="container container-align-center">

  <div class="align-center">
    <div>
      <p><img src="https://placebear.com/200/200" /></p>
      <p><a href="#">Image and link vertically and horizontally centered</a></p>
    </div>
  </div>

</div>
  
<h2>Navigation items</h2>

<div class="container">

  <nav>
    <ul class="nav">
      <li><a href="">Item 1</a></li>
      <li><a href="">Item 2</a></li>
      <li><a href="">Item 3</a></li>
      <li><a href="">Item 4</a></li>
      <li><a href="">Item 5</a></li>
      <li><a href="">Item 6</a></li>
    </ul>
  </nav>
  
</div>
            
          
!
            
              html, body {
  color: #333;
  font-size: 16px;
  line-height: 20px;
}
body {
  margin: 20px;
}

h1 {
  line-height: 1.2;
  margin-bottom: 35px;
  text-align: center;
}

h2 {
  text-align: center;
  margin-bottom: 16px;
}

.container {
  background: #eee;
  margin: 0 auto 35px;
  max-width: 920px;
  padding: 20px;
}

/* Actual code example */

.align-items-left-right {
   display: flex;
   justify-content: space-between;
}

.align-center {
  align-items: center;
  display: flex;
  height: 400px;
  justify-content: center;
  text-align: center;
}

.equal-height-columns {
  display: flex;
}
.equal-height-columns .col {
  background: #fff;
  flex: 1;
  margin: 5px;
  padding: 10px;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav li {
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
}
.nav a {
  background: #fff;
  border: 1px solid #eee;
  display: block;
  padding: 4px 10px;
  text-align: center;
}
            
          
!
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