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.

              h2 Media Query Test
p.explain The two boxes below are sized via media query. The top one uses ems, and the bottom uses pixels. With a 16px base font size, both should be identical in width. Likewise for browser zooming. But when the base font size changes, most browsers will show them with different widths. (Change your browser's font size and drag the window width to see it in action.)

h3.em Em-based media query

h3.px Pixel-based media query

h4.how-to How to change base font size
    a(href="https://support.google.com/chrome/answer/95416?hl=en") Chrome
    a(href="https://support.mozilla.org/en-US/questions/944922") Firefox
              @import compass

= break($em)
  $px: #{($em * 16)}px
  $ems: #{$em}em
  @media (min-width: $ems)
      width: $ems
        content: "#{$ems} (16px * #{$em} = #{$px})"
  @media (min-width: $px)
      width: $px
        content: "#{$px}"

  margin-bottom: 3em
p.px, p.em
  border: 1px solid #ddd
  padding: 1em 0
  background-color: lightblue
  background-color: lightgreen

  margin-top: 4em
  padding-top: 1.5em
  border-top: 1px solid #ddd

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