cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <p>Small font sizes fail in WebKit and Opera when used with ems or %. In WebKit this happens when the base font-size is set in ems or %. In Opera this happen when the font-size is set to the equivalent of 1px in ems.<p>
<p>All of the blue bars below should be 1px tall, but as you can see the first two are 6px tall when view with WebKit. All of the orange bars should be 6px tall but the first two render as 36px in WebKit.<p>

<div class="small">
  <div class="em">
    <span></span>
  </div>
  <div class="percent">
    <span></span>
  </div>
  <div class="pt">
    <span></span>
  </div>
  <div class="px">
    <span></span>
  </div>
</div>
  
<div class="large">
  <div class="em">
    <span></span>
  </div>
  <div class="percent">
    <span></span>
  </div>
  <div class="pt">
    <span></span>
  </div>
  <div class="px">
    <span></span>
  </div>
</div>
            
          
!
            
              .em      { font-size: 1em;  /* 16px */ }
.percent { font-size: 100%; /* 16px */ }
.pt      { font-size: 12pt; /* 16px */ }
.px      { font-size: 16px; /* 16px */ }

.small span, .large span {
  display: block;
  font-size: 0.0625em; /* 1px */
  height: 1em;         /* 1px */
  background-color: #00f;
}

.large span {
  height: 6em;         /* 6px */
  background-color: #f90;
}

.em, .percent, .pt, .px {
  margin-bottom: 10px; /* Space the lines out */
}
            
          
!
999px
Loading ..................

Console