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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="flex-wrapper">
  <a href="" class="one">
    <div class="overlay">
      <div class="overlay-inner">
        <h2>Title #1</h2>
        <p>Fusce vulputate orci at nulla consequat, ac tincidunt quam ultrices.</p>
      </div>
    </div>
  </a>
  <a href="" class="two">
    <div class="overlay">
      <div class="overlay-inner">
        <h2>Title #2</h2>
        <p>Quisque facilisis enim eu mi condimentum, id interdum diam pharetra.</p>
      </div>
    </div>
  </a>
  <a href="" class="three">
    <div class="overlay">
      <div class="overlay-inner">
        <h2>Title #3</h2>
        <p>Donec laoreet enim sed risus suscipit, rutrum egestas ligula tristique.</p>
      </div>
    </div>
  </a>
  <a href="" class="four">
    <div class="overlay">
      <div class="overlay-inner">
        <h2>Title #4</h2>
        <p>Etiam porta, enim non vulputate consectetur, neque lectus finibus erat, eu. </p>
      </div>
    </div>
  </a>
  <a href="" class="five">
    <div class="overlay">
      <div class="overlay-inner">
        <h2>Title #5</h2>
        <p>Cras nunc augue, egestas sed maximus non, consectetur in nunc.</p>
      </div>
    </div>
  </a>
</div>
              
            
!

CSS

              
                body {
  font: normal 18px/1.5 "Helvetica Neue", sans-serif;
}

.flex-wrapper {
  display: flex;
  height: 100vh;
}

.flex-wrapper a {
  position: relative;
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: flex .4s;
}

.flex-wrapper .one {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-001.jpg);
  background-color: red;
}

.flex-wrapper .two {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-002.jpg);
  background-color: green;
}

.flex-wrapper .three {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-003.jpg);
  background-color: steelblue;
}

.flex-wrapper .four {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-004.jpg);
  background-color: orange;
}

.flex-wrapper .five {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-005.jpg);
  background-color: tomato;
}

.flex-wrapper a:hover {
  flex: 3;
}
              
            
!

JS

              
                
              
            
!
999px

Console