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

              
                <div class="Teaser">
  <div class="Teaser-image">1</div>
  <div class="Teaser-text">Cillum amet occaecat consectetur minim sunt occaecat ex incididunt dolore eiusmod elit aliqua ut sed qui est nostrud duis qui dolor aute mollit sed ad adipisicing sunt. Cillum amet occaecat consectetur minim sunt occaecat ex incididunt dolore eiusmod elit aliqua ut sed qui est nostrud duis qui dolor aute mollit sed ad adipisicing sunt.</div>
</div>
<div class="Teaser">
  <div class="Teaser-image">2</div>
  <div class="Teaser-text">Dolor sit deserunt pariatur dolor ut nostrud dolor laborum sunt ut veniam sit et veniam reprehenderit enim nisi nisi. Dolor sit deserunt pariatur dolor ut nostrud dolor laborum sunt ut veniam sit et veniam reprehenderit enim nisi nisi.</div>
</div>
<div class="Teaser">
  <div class="Teaser-image">3</div>
  <div class="Teaser-text">Nulla cupidatat veniam voluptate consequat culpa aute adipisicing id consectetur officia eu laborum veniam quis cupidatat eiusmod elit minim officia pariatur anim.</div>
</div>
<div class="Teaser">
  <div class="Teaser-image">4</div>
  <div class="Teaser-text">Lorem ipsum sunt in sed cupidatat amet commodo pariatur pariatur id sit dolor reprehenderit irure cillum in elit veniam voluptate magna dolor sit dolor in labore exercitation nostrud aliquip ullamco do nisi duis ut ea in cillum ut dolore tempor ut labore non excepteur ea dolor veniam aute est id irure in laborum magna nisi.</div>
</div>
<div class="Teaser">
  <div class="Teaser-image">5</div>
  <div class="Teaser-text">Lorem ipsum voluptate dolor ut duis non commodo ea ut sit voluptate voluptate dolore amet mollit sint et aute in proident anim ut.</div>
</div>
<div class="Teaser">
  <div class="Teaser-image">6</div>
  <div class="Teaser-text">Dolore excepteur deserunt ut cupidatat non elit anim consequat est ut qui magna veniam sed excepteur est elit mollit voluptate adipisicing tempor aliquip in minim labore nostrud nulla eu ut irure dolor labore culpa fugiat magna.</div>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

.Teaser:not(:first-child) {
  padding-top: calc(100vw / 12);
}

.Teaser-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #236c62;
  height: 10rem;
  color: #fff;
}

.Teaser-text {
  background: #0a374e;
  padding: 1rem;
  color: #fff;
}

.Teaser:nth-child(1) {
  margin-left: calc(100vw / 12);
}

.Teaser:nth-child(1) .Teaser-text,
.Teaser:nth-child(4) .Teaser-text {
  width: calc(100vw / 3);
  margin-top: calc(-1 * 100vw / 12);
}

.Teaser:nth-child(1) .Teaser-text {
  margin-right: calc(100vw / 12);
  float: right;
}

.Teaser:nth-child(2),
.Teaser:nth-child(5){
  width: 50%;
}

.Teaser:nth-child(2) {
  float: left;
}

.Teaser:nth-child(2) .Teaser-text {
  margin-left: calc(100vw / 12);
}

.Teaser:nth-child(3),
.Teaser:nth-child(6) {
  width: calc(100vw / 3);
} 

.Teaser:nth-child(3) {
  float: right;
  margin-right: calc(100vw / 12);
  clear: right;
}

.Teaser:nth-child(4) {
  clear: both;
}

.Teaser:nth-child(4) .Teaser-text {
  margin-left: calc(100vw / 12);
  float: left;
}

.Teaser:nth-child(5) {
  float: right;
}

.Teaser:nth-child(5) .Teaser-text {
  margin-right: calc(100vw / 12);
}

.Teaser:nth-child(6) {
  float: left;
  margin-left: calc(100vw / 12);
  clear: left;
} 
              
            
!

JS

              
                
              
            
!
999px

Console