Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="index.css">
    <title>Media Queries</title>
</head>
<body>
     <h1>Making Responsive Websites</h1>
     <p><em>Media queries</em> are a great way to ensure that all users of a website have a 
    good experience. The media queries - literally '@media' as if it's asking the 
    media a question - will ask the browser of a user about it's current dimensions. 
    The browser will tell our CSS what size it is, and the CSS will rearrange and
    re-display based on those parameters. My goal here is to show how to use the 
    queries, but all we want from you right this instant is awareness that the 
    concept of media queries exists. This stuff is going on in the background of
    things like Bootstrap.</p>
</body>
</html>
              
            
!

CSS

              
                @media only screen and (min-width: 600px) {
    body {
        background-color: aquamarine;
        display: flex;
        flex-direction: row;
    }
}

@media only screen and (min-width: 800px) {
    body {
        background-color: red;
        font-family: Arial, Helvetica, sans-serif;
    }
}

@media only screen and (min-width: 1000px) {
    body {
        background-color: coral;
        font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
        display: flex;
        flex-direction: column;
    }
}

@media only screen and (min-width: 1200px) {
    body {
        background-color: salmon;
        font-family: Georgia, 'Times New Roman', Times, serif;
    }
}


              
            
!

JS

              
                
              
            
!
999px

Console