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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <article class="first">
  <h1>Simple :not() example</h1>
  <p>All the divs are set to having a background blue, however we don't want either purple or red to have this background. We set a background to red if the div is 'not' blue.</p>
  <div class="blue">
    A lovely blue div
  </div>

  <div class="purple">
    A lovely purple div
  </div>

  <div class="red">
    A lovely red div
  </div>
</article>

<article class="second">
  <h1>Now to chain together classes</h1>
  <p>The same applies here, we want the purple and red divs to have a red background, so we need to specify a :not() on both the blue and green divs.</p>
  <div class="blue">
    A lovely blue div
  </div>

  <div class="purple">
    A lovely purple div
  </div>

  <div class="red">
    A lovely red div
  </div>
  
  <div class="green">
    A lovely green div
  </div>
</article>
            
          
!
            
              article { overflow: hidden; padding: 2%; }
div {
  width: 24%;
  height: 100px;
  padding: 2%;
  float: left;
  border: 2px solid black;
  background: royalblue;
}

.first div:not(.blue) { background: crimson; }

.second div:not(.blue):not(.green) { background: crimson; }
            
          
!
999px
Loading ..................

Console