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.

            
              <h2>iOS click bubbling tests</h2>

<p>On iOS, clicks on non-clickable elements (like DIV) will not bubble to the "body" or "document" unless the element has this CSS:</p>

<pre><code>{ cursor: pointer; }</code></pre>

<p>Note: must be applied to the actual element.</p>

<p>Note: does not work when applied to the pseudo-element only.</p>

<p>Note: does not work when applied to <code>:hover</code> state.</p>

<div class="box alpha">Alpha</div>
<div class="box beta">Beta</div>
            
          
!
            
              .box {
  position: relative;
  margin-bottom: 120px;
  padding: 20px;
  background: red;
  line-height: 20px;
  
  &::after {
    position: absolute;
    top: 70px;
    left: 0;
    padding: 20px;
  }
}

.alpha {
  background: red;
  
  &:hover {
    // Does not make clicks bubble
    cursor: pointer;
  }
  
  &::after {
    content: 'Alpha ::after';
    background: pink;
    // Does not make clicks bubble
    cursor: pointer;
  }
}

.beta {
  background: limegreen;
  // Will make clicks bubble
  cursor: pointer;
  
  &::after {
    content: 'Beta ::after';
    background: lightgreen;
  }
}
            
          
!
            
              jQuery(document).on('click', '.box', function () {
  console.log('Click bubbled to document.');
});

jQuery('body').on('click', '.box', function () {
  console.log('Click bubbled to body.');
});
            
          
!
999px
Loading ..................

Console