cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

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

            
          
!
            
              $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;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console