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="box">
  <h1 class="box__heading">Heading <br>(font size is 10% of masthead's height)</h1>
  <p class="box__perex">Perex (font size is 6% of masthead's height). Let's try to change window width. … Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa voluptate praesentium ipsam nulla non sint, dolor reprehenderit sunt, assumenda, eius eum omnis cumque ullam, maxime obcaecati dolorem pariatur. Dignissimos, corporis.</p>  
</div>

<div class="content">

  <p>Try to change page width. This is regular font size…</p>
  
  <p>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi provident possimus, alias officiis quam incidunt eum hic iusto placeat nesciunt quia maiores ipsa cumque, molestias quos quod laborum nemo omnis.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur saepe tenetur, vel porro cupiditate. Exercitationem, quisquam ratione suscipit aspernatur est tenetur quidem omnis amet. Debitis deleniti est sit qui unde.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis repellat cupiditate inventore nemo, ipsam distinctio praesentium, molestias, architecto ratione dolores, amet! Voluptatum quis rerum earum maiores, nulla ad, rem adipisci?</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatum tempora quis veniam, reprehenderit consequatur error iure odio, at sequi assumenda fugit, officia maiores molestiae corporis. Ipsa architecto incidunt perferendis illum.</p>
  
  
</div>  


<!--[if lte IE 8]>
<script>
var a = document.body;
if (a.classList) {
    a.classList.add('old-ie');
} else {
    a.className += ' old-ie';
}
</script>
<![endif]-->

              
            
!

CSS

              
                $boxHeightPercent: "( (100vw - 2em) / 100 / 16 * 9 )";

.box {
  box-sizing: border-box;
  text-align: center;
  padding-left: 1em;
  padding-right: 1em;    
  padding-top: 1.2em;  /* Fallback for legacy browsers */
  padding-top: calc( 6 * #{$boxHeightPercent} );
  font-family: "Roboto Condensed", sans-serif;
  background: #48440E;
  color: #EDE29F;
}

// Masthead is 16:9

.box { 
  padding-bottom: 56.25%;  
  height: 0;  
  
  .old-ie & {
    padding-bottom: 1.2em;  /* Fallback for legacy browsers */
    height: auto;
  }
}

.box__heading { 
  font-size: 2em; /* Fallback for legacy browsers */
  font-size: calc( 10 * #{$boxHeightPercent} );
  padding-top: 1.6em;  /* Fallback for legacy browsers */
  padding-top: calc( 8 * #{$boxHeightPercent} );
  
  .old-ie & {
    padding-top: 0;  /* Fallback for legacy browsers */
  }  
}

.box__perex {
  font-size: 1.2em;  /* Fallback for legacy browsers */  
  font-size: calc( 6 * #{$boxHeightPercent} );
}

.content {
  margin: 1em;
}

body {
  margin: 0;
  padding: 0;
  background: #EDE29F;
  color: #48440E;
}
              
            
!

JS

              
                
              
            
!
999px

Console