cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

              <!-- :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>
.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; }

Loading ..................