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="outside-container">
  <h1>Flexbox Tutorial</h1>
  <header>
    <div class="nav flexitem">Nav 1</div>
    <div class="nav flexitem">Nav with long text 2</div>
    <div class="nav flexitem">Nav 3</div>
    <div class="nav flexitem">Nav with long text 4</div>
    <div class="nav flexitem">Nav 5</div>
  </header>
  <div class="flexcontainer">
    <div class="sidebar-left flexitem">
      Sidebar Left
    </div>
    <div class="content flexitem">
      Content
      <div class="inner content">
        <div class="teaser flexitem">
          I'm a Teaser box in Content 1
          <div class="inner teaser">
            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
          </div>
        </div>
        <div class="teaser flexitem">
          I'm a Teaser box in Content 2
          <div class="inner teaser">
            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          </div>
        </div>
        <div class="teaser flexitem">
          I'm a Teaser box in Content 3
          <div class="inner teaser">
            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et 
          </div>
        </div>
        <div class="teaser flexitem">
          I'm a Teaser box in Content 4
          <div class="inner teaser">
            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
          </div>
        </div>
        <div class="teaser flexitem">
          I'm a Teaser box in Content 5
          <div class="inner teaser">
            Lorem ipsum dolor sit amet, consetetur
          </div>
        </div>
      </div>
    </div>
    <div class="sidebar-right flexitem">
      Sidebar Right
    </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  color: #fff;
  background-color: #e8e8e8;
  width: 100%;
  font-family: 'Georgia';
}

.outside-container {
  background-color: #fff;
  width: 90%;
  padding: 15px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: #002e51;
}

header {
  background-color: #002e51;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.flexcontainer {
  background-color: #002e51;
  color: #fff;
  padding: 15px;
  /*Display as Flex*/
  display: flex;
  /*Set direction*/
  flex-direction: row;
  justify-content: space-between;
}

.sidebar-left,
.sidebar-right {
  width: 12%;
}

.flexitem {
  background-color: #fb511f;
  color: #fff;
  padding: 15px;
}

.content.flexitem {
  width: 65%;
}

.inner.content {
  height: 600px;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: stretch;
  align-content: stretch;
}

.teaser.flexitem {
  margin-bottom: 20px;
  background-color: #e3e3e3;
  color: #002e51;
  width: calc(50% - 40px);
  font-size: 32px;
}

.inner.teaser {
  font-size: 16px;
  margin-top: 15px;
}
              
            
!

JS

              
                
              
            
!
999px

Console