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

              
                <div>
    <h1>CSSOM Example</h1>

    <p>Using the CSS object model exposed by CSS Regions you can create regions dynamically at runtime.</p>
    <article id="art">
        <div class="myregions region-small-height"></div>
        <div class="myregions region-small-height"></div>
    </article>
</div>
<div id="source">
    <p>
        CSS Pseudo-elements is a new proposal by Adobe to the W3C that allows multiple "before" and "after" pseudo-elements to be generated by a single element.
        In this example you can see how another region (the blue one) is added after the page is loaded and the CSSRegions object is created.
        <a href="http://corlan.org">This is a very long link!</a>
    </p>
    <p>
        Multiple pseudo-elements cover use cases collected on css-tricks.com.
    </p>
    <p>
        This is a prototype JavaScript implementation to give you a feel for how the code will look like and behave. Please keep in mind that this is just experimental stuff and treat it accordingly.
    </p>
</div>
              
            
!

CSS

              
                      body {
            width: 80%;
            margin: 50px 10% 10%;
            font-family: Palatino, Georgia, serif;
            background-color: white;
        }

        #source {
            flow-into: article;
            clear: both;
        }

        .myregions {
            flow-from: article;
            region-fragment: break;
            float: left;
            width: 25%;
            min-width: 200px;
            margin: 0px 20px 20px;
            padding: 7px;
            background-color: #b0dcff;
            height: auto;
        }

        .region-small-height {
            background-color: #dedede;
            height: 200px;
            overflow: hidden;
        }

        p {
            line-height: 1.6em;
            margin-top: 0px;
        }
              
            
!

JS

              
                   function init(){
        
        function on_region_update(e) {
            var art, div;
            if (e.target.overset) {
                div = document.createElement("div");
                div.className = "myregions";
                art = document.getElementById("art");
                art.appendChild(div);
            }
        }
        
        var flow = document.getNamedFlow("article");
        flow.addEventListener("regionfragmentchange", on_region_update);
        on_region_update({target:flow});
        
    }
    
    window.addEventListener('load', init)

              
            
!
999px

Console