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

              
                
              
            
!

CSS

              
                body:before{display:block; content:'hello';}


/* 3/2 and 6/1 -- out of range*/
@media screen and (min-aspect-ratio: 3/1) and (max-aspect-ratio: 6/1){
  body{background:red;}
  body:before{content:'out of range'}
}



/* 14/5 and 3/1 */
@media screen and (min-aspect-ratio: 14/5) and (max-aspect-ratio: 7/2){
  body{background:#000;}
  body:before{content:'between 14/5 and 3/1'}
}
/* 5/2 and 14/5 */
@media screen and (min-aspect-ratio: 5/2) and (max-aspect-ratio: 14/5){
  body{background:#111;}
  body:before{content:'between 5/2 and 14/5'}
}
/* 9/4 and 5/2 */
@media screen and (min-aspect-ratio: 9/4) and (max-aspect-ratio: 5/2){
  body{background:#222;}
  body:before{content:'between 9/4 and 5/2'}
}
/* 11/5 and 9/4 */
@media screen and (min-aspect-ratio: 11/5) and (max-aspect-ratio: 9/4){
  body{background:#333;}
  body:before{content:'between 11/5 and 9/4'}
}
/* 13/6 and 11/5 */
@media screen and (min-aspect-ratio: 13/6) and (max-aspect-ratio: 11/5){
  body{background:#444;}
  body:before{content:'between 13/6 and 11/5'}
}

/* 15/7 and 13/6 */
@media screen and (min-aspect-ratio: 15/7) and (max-aspect-ratio: 13/6){
  body{background:#555;}
  body:before{content:'between 15/7 and 13/6'}
}

/* 2/1 and 15/7 */
@media screen and (min-aspect-ratio: 2/1) and (max-aspect-ratio: 15/7){
  body{background:#666;}
  body:before{content:'between 2/1 and 15/7'}
}

@media screen and (min-aspect-ratio: 15/8) and (max-aspect-ratio: 2/1){
  body{background:#777;}
  body:before{content:'between 15/8 and 2/1'}
}

/* 7/4 and 15/8 */
@media screen and (min-aspect-ratio: 7/4) and (max-aspect-ratio: 15/8){
  body{background:#888;}
  body:before{content:'between 7/4 and 15/8'}
}
/* 11/7 and 7/4 */
@media screen and (min-aspect-ratio: 11/7) and (max-aspect-ratio: 7/4){
  body{background:#999;}
  body:before{content:'between 11/7 and 7/4'}
}
/* 13/9 and 11/7 */
@media screen and (min-aspect-ratio: 13/9) and (max-aspect-ratio: 11/7){
  body{background:#aaa;}
  body:before{content:'between 13/9 and 11/7'}
}
/* 4/3 and 13/9 */
@media screen and (min-aspect-ratio: 4/3) and (max-aspect-ratio: 13/9){
  body{background:#bbb;}
  body:before{content:'between 4/3 and 13/9'}
}
/* 8/7 and 4/3 */
@media screen and (min-aspect-ratio: 8/7) and (max-aspect-ratio: 4/3){
  body{background:#ccc;}
  body:before{content:'between 8/7 and 4/3'}
}
/* 14/15 and 8/7 */
@media screen and (min-aspect-ratio: 14/15) and (max-aspect-ratio: 8/7){
  body{background:#ddd;}
  body:before{content:'between 14/15 and 8/7'}
}
/* 5/6 and 14/15 */
@media screen and (min-aspect-ratio: 5/6) and (max-aspect-ratio: 14/15){
  body{background:#eee;}
  body:before{content:'between 5/6 and 14/15'}
}
/* 7/10 and 5/6 */
@media screen and (min-aspect-ratio: 7/10) and (max-aspect-ratio: 5/6){
  body{background:#fff;}
  body:before{content:'between 7/10 and 5/6'}
}
/* 5/9 and 7/10 */
@media screen and (min-aspect-ratio: 5/9) and (max-aspect-ratio: 7/10){
  body{background:yellow;}
  body:before{content:'between 5/9 and 7/10'}
}

/* 1/10 and 5/9 --- out of range*/
@media screen and (min-aspect-ratio: 1/10) and (max-aspect-ratio: 5/9){
  body{background:red;}
  body:before{content:'out of range - too narrow'}
}


/* super landscape to -

14/5 and 3/1
11/4 and 14/5
8/3 and 11/4
13/5 and 8/3
5/2 and 13/5
12/5 and 5/2
7/3 and 12/5
16/7 and 7/3

9/4 and 16/7

11/5 and 9/4
13/6 and 11/5
15/7 and 13/6
2/1 and 15/7

15/8 and 2/1

13/7 and 15/8
11/6 and 13/7
9/5 and 11/6
16/9 and 9/5
7/4 and 16/9
12/7 and 7/4
5/3 and 12/7
13/8 and 5/3
8/5 and 13/8
11/7 and 8/5
14/9 and 11/7
3/2 and 14/9
16/11 and 3/2
13/9 and 16/11
10/7 and 13/9
7/5 and 10/7
11/8 and 7/5
15/11 and 11/8
4/3 and 15/11
13/10 and 4/3
9/7 and 13/10
14/11 and 9/7
5/4 and 14/11
16/13 and 5/4
11/9 and 16/13
6/5 and 11/9
13/11 and 6/5
7/6 and 13/11
15/13 and 7/6
8/7 and 15/13
9/8 and 8/7
10/9 and 9/8
11/10 and 10/9
12/11 and 11/10
13/12 and 12/11
14/13 and 13/12
15/14 and 14/13
16/15 and 15/14
1/1 and 16/15

-->   1/1 to super portrait -->

15/16 and 1/1
14/15 and 15/16
13/14 and 14/15
12/13 and 13/14
11/12 and 12/13
10/11 and 11/12
9/10 and 10/11
8/9 and 9/10
7/8 and 8/9
13/15 and 7/8
6/7 and 13/15
11/13 and 6/7
5/6 and 11/13
9/11 and 5/6
13/16 and 9/11
4/5 and 13/16
11/14 and 4/5
7/9 and 11/14
10/13 and 7/9
3/4 and 10/13
11/15 and 3/4
8/11 and 11/15
5/7 and 8/11
7/10 and 5/7
9/13 and 7/10
2/3 and 11/16
9/14 and 2/3
7/11 and 9/14
5/8 and 7/11
8/13 and 5/8
3/5 and 8/13
7/12 and 3/5
4/7 and 7/12
9/16 and 4/7
5/9 and 9/16

super portrait!
              
            
!

JS

              
                
              
            
!
999px

Console