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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <header class="header">
  <div class="header__title">
    <h1>
      <code>not()</code>
    </h1>
  </div>
  <div class="header__reference">
    <ul class="reference-list">
      <li><a class="reference-list__link" href="https://developer.mozilla.org/en-US/docs/Web/CSS/:not">MDN reference</a></li>
      <li><a class="reference-list__link" href="https://caniuse.com/#feat=mdn-css_selectors_not">caniuse Support</a></li>
    </ul>
  </div>
</header>

<main>
  <div class="example">
    <p>
      In this example we are using the <code>not()</code> selector to apply a yellow outline to anything that is <strong>not</strong> a <code>p</code> element in the demo area. Notice that the selector targets not only each list item in the <code>ul</code> element, but also the <code>ul</code> element itself:
    </p>
    <div class="example__demo example__demo--not">
      <p>
        Oranges are round, orange-colored fruit that grow on trees. There are many different kinds of oranges, including: 
      </p>
      <ul>
        <li>Valencia</li>
        <li>Navel</li>
        <li>Clementine</li>
        <li>Cara Cara</li>
        <li>Lima</li>
      </ul>
      <p>
        Oranges are a commonly available source of Vitamin C, and last longer than many other fruits when stored. They are easy to transport because each orange comes in its own tough skin which acts as a container.
      </p>
      <img
        alt="A basket of oranges sitting in a red crate."
        src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/naomi-koelemans-633994-unsplash.jpg" />
      <p>Orange description taken from <a href="https://simple.m.wikipedia.org/wiki/Orange_(fruit)">Simple English Wikipedia</a>.
    </div>
  </div>

  <aside>
    <p>
      <small>Photo by <a href="https://unsplash.com/photos/QI5nFAUXWvM">Naomi Koelemans</a> on <a href="https://unsplash.com/">Unsplash</a>.</small>
    </p>
  </aside>  
</main>
              
            
!

CSS

              
                // Demo
.example__demo--not :not(p) {
  outline: 0.25em solid var(--color-sand);
}


// Pen Setup
.example__demo--not {  
  a,
  p,
  ul {
    color: var(--color-cinder);
  }
  
  img {
    height: auto;
    margin-top: var(--size-epsilon);
    width: 100%;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console