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

              
                <main class="grid">
    <div class="item item--contained">
        <h1>The Old Man and the Sea</h1>
        <p>He was an old man who fished alone in a skiff in the Gulf Stream and he had gone eighty-four days now without taking a fish. In the first forty days a boy had been with him. But after forty days without a fish the boy’s parents had told him that the old man was now definitely and finally salao, which is the worst form of unlucky, and the boy had gone at their orders in another boat which caught three good fish the first week. It made the boy sad to see the old man come in each day with his skiff empty and he always went down to help him carry either the coiled lines or the gaff and harpoon and the sail that was furled around the mast.</p>
    </div>
    <div class="item item--full blockquote">
        <p>The sail was patched with flour sacks and, furled, it looked like the flag of permanent defeat.</p>
    </div>
    <div class="item item--contained">
        <p>The old man was thin and gaunt with deep wrinkles in the back of his neck. The brown blotches of the benevolent skin cancer the sun brings from its reflection on the tropic sea were on his cheeks. The blotches ran well down the sides of his face and his hands had the deep-creased scars from handling heavy fish on the cords. But none of these scars were fresh. They were as old as erosions in a fishless desert. </p>
    </div>
</main>
              
            
!

CSS

              
                .grid {
    display: grid;
    grid-template-columns: 
        [viewport-start] minmax(1em, 1fr)
        [container-start] minmax(0, 30em) [container-end]
        minmax(1em, 1fr) [viewport-end];
}

.item--contained {
    grid-column: container;
}

.item--full { 
    grid-column: viewport; 
    display: inherit;
    grid-template-columns: inherit;
    
    & > * {
        grid-column: container;
    }
}




/* make it look pretty */
body {
    color: #333;
    font-family: helvetica;
    font-weight: lighter;
    font-size: 18px;
    line-height: 1.35em;
}
h1 {
    font-size: 1.75em;
    font-weight: bold;
    margin: .75em 0;
}
p {
    margin-bottom: .75em;
    
    &:last-child {
        margin: 0;
    }
}
.item {
    padding: 1em 0;
}
.blockquote {
    padding: 2em 0;
    color: #fff;
    background: #82cac4;
}
              
            
!

JS

              
                
              
            
!
999px

Console