Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<style>
  body{  
    -webkit-text-size-adjust:100%; 
    }

  /* 
    FAUX-FIXED: Fixed Object Scrolling Content Interactive Email Technique
    By: Justin Khoo @freshinbox

    Clients supported:
    - iOS: Mail, Gmail, Yahoo! Mail App
    - Android: Samsung Client, Gmail App
    - Mac: Mail, Outlook
    - Webmail: Gmail, Yahoo! Mail, AOL

    Clients specifically excluded:;
    - GANGA - no style support
    - Outlook.com - does not work in Chrome browser
    - Outlook iOS/Android
    - Outlook desktop/Windows 10 - conditional comments block
    - Windows 10 mobile - no media query support
    - Yahoo! Mail Android - style support only in body
    - Android 4.4 - Native, Gmail
  */


  /*
  iOS: Mail, Gmail, Inbox, Yahoo! Mail, Outlook;
  Android: Samsung, Gmail, Inbox, Outlook (need to block);
  Mac: Outlook, Apple Mail;
  Webmail: Gmail, Yahoo! Mail, AOL Mail;
  */
  .yfix{}
  @media screen {
    .interactive {
      display:block!important;
      max-height:none!important;
      overflow:visible!important;
      max-width:100%;
    }
    .fallback{
      display:none;
    }
  }

  @media (max-device-width:800px)   { 
    /* 
    Block for Android 4.4 using calc(vh)
    We don't filter by (min-resolution: .001dpcm) because 4.4 native doesn't respond to it
    while 4.4 Gmail does(?)
     */

    .interactive {
      display:block!important;
      overflow:hidden!important;
      max-height:0px!important;
      max-height:calc(100vh + 1000px)!important;
    }
    .fallback{
      display:block!important;
      overflow:hidden!important;
      max-height:none!important;
      max-height:calc(0vh - 1000px)!important;
    }
  }

  /* 
    Code to block Outlook on Android.
    The following "Chrome" specific media queries only allow 2 Android clients through
     - Samsung & Outlook
    (Gmail doesn't support -webkit-min-device-pixel-ratio, Android 4.4 does not respond to min-res)
  */
  .yfix{}
  @media (max-device-width:800px) and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) { 
    /* Block for Samsung and Outlook Android */
    .interactive {
      display:none!important;
    }
    .fallback{
      max-height:none!important;
    }
    /* Reenable on Samsung only: 
      Outlook on android does not support summary attribute */
    .interactive[summary="block-outlook-android"] {
      display:block!important;
    }
    .fallback[summary="block-outlook-android"] {
       max-height:calc(0vh - 1000px)!important;
    }
  }

  @media screen and (max-device-width:800px){
    /* no need space for scrollbars in mobile */
    .container{
      width:400px!important;
    }
  }

</style>
</head>
<body>

<table width="100%"><tr><td>

<!--[if !mso]><!-->
<div class="interactive" summary="block-outlook-android" style="display:none;max-height:0px;overflow:hidden;">
  <div class="container" style="width:420px;margin:0 auto;">
    <!-- "absolute" position ball -->
    <div style="height:0px;max-height:0px;overflow:visible!important;">
      <div style="display:inline-block;position:relative;opacity:0.999;margin-top:100px;margin-left:166px;width:70px;"><img src="http://freshinbox.com/examples/faux-fixed/images/bball.png" width="100%"></div>
    </div>
    <!-- scrolling canvas -->
    <div style="height:360px;max-height:400px;overflow:auto;border:2px solid black;background-color:#97defb;">
      <div style="height:630px;background-image:url('http://freshinbox.com/examples/faux-fixed/images/bball-short-background.png')">
      <img src="http://freshinbox.com/examples/faux-fixed/images/bball-short-foreground.png" style="display:block;width:100%;position:relative;opacity:0.999;">
      </div>
    </div>
  </div>
</div>  
<!--<![endif]-->

<div class="fallback" summary="block-outlook-android">
<center>
  <img src="http://freshinbox.com/examples/faux-fixed/images/bball-sad.png" width="400" style="max-width:100%;display:block;">
</center>
</div>

</td></tr></table>

</body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console