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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <h1>Hello World</h1>
<ul>
  <li>This text color is red between medium (960px) and small screen (768px)</li>
  <li>Become green when below extra small screen (480x)</li>
  <li>And have larger font size when below 300px</li>
</ul>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat mollitia laudantium minima reprehenderit</p>
<p>Laboriosam nulla inventore amet ratione deserunt delectus excepturi beatae omnis modi repudiandae molestias quo debitis quia ullam</p>
<p>Voluptas sit ab? In labore cumque accusantium, officiis eius iure quisquam eligendi dicta voluptatum adipisci perspiciatis repellat ipsam?</p>
<p>Eos dolore ex dolor exercitationem iusto, doloribus alias odit. Deserunt fugiat inventore quidem architecto repudiandae. Error harum in beatae nihil quasi, vel dolore odio blanditiis, doloribus ad adipisci.</p>
<p>Totam aspernatur accusamus. Quas sunt voluptatibus, tenetur aliquid quos quibusdam placeat laboriosam est earum! Quaerat laborum consectetur minus mollitia exercitationem velit tempora voluptatum quos!</p>
              
            
!

CSS

              
                // Extra Small (mobile)
$below-xs: "max-width:480px";
$above-xs: "min-width:481px";

// Small (tablet)
$below-s: "max-width:768px";
$above-s: "min-width:769px";

// Medium (landscape tablet)
$below-m: "max-width:960px";
$above-m: "min-width:961px";

// Large (content max-width)
$below-l: "max-width:1120px";
$above-l: "min-width:1121px";

$portrait: "orientation: portrait";
$landscape: "orientation: landscape";
$retina: "min-resolution: 192dpi";


@function below( $size-px ) {
  @return "max-width: #{$size-px}";
}

@function above( $size-px ) {
  @return "min-width: #{$size-px}";
}

// -------

body {
  color: black;
  
  @media ($above-s) and ($below-m) {
    color: red;
  }

  @media ($below-xs) {
    color: green;
  }
    
  @media (below(300px)) {
    font-size: 20px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console