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

              
                <!-- :empty -->
<section class="example-cntr empty">
    <h1>CSS <code>:empty</code> pseudo-class</h1>
    <p>The <code>:empty</code> pseudo-class targets elements that have no content of any kind in them, at all.</p>
    <p>If it has any type of character, even a space, then the element is <span class="underline">not</span> considered empty.</p>
    <p>In the following example <span class="red">Red</span> boxes have content and <span class="yellow">Yellow</span> boxes are empty:</p>
    <div class="flex-ctnr">
        <div>I have content, thus I'm red…</div>
        <div> </div> <!-- A space is considered content so it’s red -->
        <div></div> <!-- Totally empty element so it’s yellow -->
        <div><!-- This comment inside isn’t considered content so it’s yellow --></div>
    </div>
</section>
              
            
!

CSS

              
                //:empty
.empty {
    .flex-ctnr div {
        display: flex;
        flex: 1;
        justify-content: center;
        align-items: center;
        margin: 0 5px;
        padding: 3px;
        background: $r;
    }
    .flex-ctnr div:empty { background: $y; }  
}


//Styling stuff not needed for demo
body { text-align: left; }
.example-cntr {
    max-width: 800px;
    margin: auto;
    padding: 20px 50px;
    box-shadow: 0 1px 2px rgba(black,.3);
    background: rgba(black,.15);    
}
h1 {
    text-transform: none;
    border-bottom: #636363 1px dotted;
    code {
        display: inline-block;
        margin-bottom: 10px;
        color: $y;
        background: none;
        box-shadow: none;
    }
}
.flex-ctnr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}
code { font-size: 1em; }
.underline { text-decoration: underline; }
$r: lighten($r,12);
.red { color: $r; }
.green { color: $g; }
.yellow { color: $y; }

              
            
!

JS

              
                
              
            
!
999px

Console