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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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="min-width"></div>
<div class="height"></div>
<div class="device-aspect-ratio"></div>
<div class="portrait"></div>
<div class="landscape"></div>
<div class="color"></div>
<div class="color-9"></div>
<div class="monochrome"></div>
<div class="resolution-low"></div>
<div class="resolution-hi"></div>
<div class="scan"></div>
<div class="grid"></div>

<div class="all"></div>
<div class="braille"></div>
<div class="embossed"></div>
<div class="handheld"></div>
<div class="print"></div>
<div class="projection"></div>
<div class="screen"></div>
<div class="speech"></div>
<div class="tty"></div>
<div class="tv"></div>
              
            
!

CSS

              
                body { background: #444; }
div {
     background: #666;
     color: #fff;
     text-align: center;
     font:   2rem Helvetica;
     float: left;
     padding: 1rem;
     margin: 1rem;
     min-height: 3rem;
      &.min-width {
        @media ( min-width: 1200px)
        { &:before { content: "Width is more than 1200px"} }
      }
      &.height {
        @media ( min-height: 100px)
        { &:before { content: "Height is more than 100px"}}
      }
      &.portrait {
        @media (orientation: portrait)
        { &:before { content: "Portrait"}}
      }
      &.landscape {
        @media (orientation: landscape)
        { &:before { content: "Landscape"}}
      }
      &.device-aspect-ratio {
        @media ( device-aspect-ratio: 1680/1050)
          /* 32/18 or 1280/720 or 2560/1440 or 16/9 or 
          1680/1050 macbook pro  - this accepts min-max prefixes */
        { &:before { content: "Device Aspect Ratio is 1680/1050"}}
      }
      &.color {
        /* The ‘color’ media feature describes the number of bits 
        per color component of the output device. If the device
        is not a color device, the value is zero. */
        @media (min-color: 2)
        { &:before { content: "Has color"}}
      }
      &.color-9 {
        @media (min-color: 9)
        { &:before { content: "Most computers have 8 bits per color"}}
      }
      &.monochrome {
        /* The ‘monochrome’ media feature describes the number of bits
        per pixel in a monochrome frame buffer. If the device is not 
        a monochrome device, the output device value will be 0. 
        What is a monochrome device?
        https://en.wikipedia.org/wiki/Monochrome_monitor */
        @media not all and (min-monochrome: 2)
        { &:before { content: "Not monochrome"}}
      }
      &.resolution-low {
        /* The following @media rule uses Media Queries to assign 
        some special style rules to devices that use two or more 
        device pixels per CSS px unit 
        http://www.w3.org/TR/css3-values/#resolution */
        @media (min-resolution: 1dppx)
        { &:before { content: "Low-res"}}
      }
      &.resolution-hi {
        @media (min-resolution: 2dppx)
        { &:before { content: "High-res 'retina'"}}
      }
      &.scan {
        @media (scan: progresive)
        { &:before { content: "Scan"}}
      }
      &.grid {
        /* If the output device is grid-based -> e.g., a "tty" terminal, 
        or a phone display with only one fixed font - such as older flip phones */
        @media not all and (grid)
        { &:before { content: "Not grid"}}
      }
      /* all Suitable for all devices.*/
      &.all {  @media all { &:before { content: "All"}}  } 
      /* braille Intended for braille tactile feedback devices.*/
      &.braille {  @media not braille { &:before { content: "Not Braille"}}  } 
      /* embossed Intended for paged braille printers.*/
      &.embossed {  @media not embossed { &:before { content: "Not Embossed"}}  } 
      /* handheld Intended for handheld devices (typically small screen, limited bandwidth).*/
      &.handheld {  @media  not handheld { &:before { content: "Not Handheld"}}  } 
      /* print Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.*/
      &.print {  @media not print { &:before { content: "Not Print"}}  } 
      /* projection Intended for projected presentations, for example projectors. Please consult the section on paged media for information about formatting issues that are specific to paged media.*/
      &.projection {  @media not projection { &:before { content: "Not Projection"}}  } 
      /* screen Intended primarily for color computer screens.*/
      &.screen {  @media screen { &:before { content: "Screen"}}  } 
      /* speech Intended for speech synthesizers. Note: CSS2 had a similar media type called 'aural' for this purpose. See the appendix on aural style sheets for details.*/
      &.speech {  @media not speech { &:before { content: "Not Speech"}}  } 
      /* tty Intended for media using a fixed-pitch character grid (such as teletypes, terminals, or portable devices with limited display capabilities). Authors should not use pixel units with the "tty" media type.*/
      &.tty {  @media not tty { &:before { content: "Not TTY"}}  }
      /* tv Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available). Media type names are case-insensitive.*/
      &.tv {  @media not tv { &:before { content: "Not TV"}}  }
 }
              
            
!

JS

              
                
              
            
!
999px

Console