Pen Settings

HTML

CSS

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.

+ 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

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.

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

              
                <h1>Old Lobotomized owl</h1>
<p><a href="https://codepen.io/tjbenton21/pen/zxGjJz?editors=110">Click here to see a better version</a> of this selector</p>
<section>
  <div>
    <div>nothing above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <meta />
    <div>&lt;meta /&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <link />
    <div>&lt;link&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <script></script>
    <link rel="stylesheet" href="" />
    <div class="add-a-lot-of-margin-top">&lt;div&gt;, &lt;script&gt;, and &lt;link /&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <div>nothing above</div>
    <script></script>
    <link rel="stylesheet" href="" />
    <div>&lt;div&gt;, &lt;script&gt;, and &lt;link /&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
</section>


<section>
    <div>
    <div>nothing above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <meta />
    <div>&lt;meta /&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <link />
    <div>&lt;link&gt; above</div>
    <div>&lt;div&gt; above</div>
  </div>
  <div>
    <div>nothing above</div>
    <script></script>
    <div>&lt;script&gt; above</div>
    <div class="reset" style="background: red">&lt;div&gt; above, and class of reset</div>
  </div>
  <div>
    <div>nothing above</div>
    <script></script>
    <div class="reset" style="background: red">&lt;script&gt; above, and class of reset</div>
  </div>
</section>

              
            
!

CSS

              
                @import "compass/css3";

* + *{
  margin-top: 1em;
}

// @name Margins off
// @description - This resets the margin-top to what it was originally, without the Lobotomized Owl selector
// @todo Possibly rename this to be .reset-extended
.margins-off > * + *{
  margin-top: 0;
  margin-top: initial;
}

// @name Compact
// @description - This is used to make sections compact when needed. It is half the size of the Lobotomized Owl selector
.compact > * + *{
  margin-top: .5em;
}


// To show that reset doesn't cause any issues with specificity.
.reset{
  list-style: none outside none;
  margin: 0;
  padding: 0;
}


// for demo purposes only.
body{
  font-size: 12px;
  line-height: 1em;
}
$color: rgba(black, .25);
div, section{
  background: $color;
  padding: 10px;
}
              
            
!

JS

              
                
              
            
!
999px

Console