octocatstartv

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
p.em

h3.px Pixel-based media query
p.px

h4.how-to How to change base font size
ul
  li
    a(href="https://support.google.com/chrome/answer/95416?hl=en") Chrome
  li
    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)
    p.em
      width: $ems
      &:before
        content: "#{$ems} (16px * #{$em} = #{$px})"
  @media (min-width: $px)
    p.px
      width: $px
      &:before
        content: "#{$px}"



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

.how-to
  margin-top: 4em
  padding-top: 1.5em
  border-top: 1px solid #ddd
    
+break(6)
+break(12)
+break(18)
+break(24)
+break(30)
+break(36)
+break(42)
+break(48)
+break(54)
+break(60)
+break(66)
+break(72)
+break(78)
+break(84)
+break(90)
+break(96)
+break(102)

            
          
!
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