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

              
                <div class="container">
  <input type="checkbox" class="input" id="input1" name="inputs">
	<input type="checkbox" class="input" id="input2" name="inputs">
	<input type="checkbox" class="input" id="input3" name="inputs">
  <label for="input1">
    <div id="b1" class="button">1</div>
  </label>
  <label for="input2">
    <div id="b2" class="button">2</div>
  </label>
  <label for="input3">
    <div id="b3" class="button">3</div>
  </label>
  <div id="content1" class="content">
    <div style="text-align: right;">
      <label for="input1" class="cross">X</label>
    </div>
    <h1>Content one</h1>
    <p class="bodyCopy">Additional content goes here.</p>
    <a href="#" class="cta">Find out more</a>
  </div>
  <div id="content2" class="content">
    <div style="text-align: right;">
      <label for="input2" class="cross">X</label>
    </div>
    <h1>Content two</h1>
    <p class="bodyCopy">Additional content goes here.</p>
    <a href="#" class="cta">Find out more</a>
  </div>
  <div id="content3" class="content">
    <div style="text-align: right;">
      <label for="input3" class="cross">X</label>
    </div>
    <h1>Content three</h1>
    <p class="bodyCopy">Additional content goes here.</p>
    <a href="#" class="cta">Find out more</a>
  </div>
</div>
              
            
!

CSS

              
                body { margin: 0 !important; padding: 0 !important; width: 100% !important; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important; }
.container { position: relative; overflow: hidden; height: 60vw; background-image:url(https://source.unsplash.com/POqJeWrVfnU/1600x900); background-size: cover; }
input { display: none; }
p { margin: 0; }
.button { color: white; font-weight: bold; font-size: 20px; background-color: #d32f2f; display: block; padding: 10px 16px; border-radius: 100%; cursor: pointer; animation: fadein .5s; animation: pulse 1.5s infinite; }
.content { background: white; padding: 1rem 1rem 2rem 1rem; text-align: center; display: none; margin: 10%; border-radius: 8px; box-shadow: 0 4px 2px -2px rgba(211,47,47,0); }
.cross { font-weight: bold; }
#b1 { position: absolute; left: 73%; top: 12%; }
#b2 { position: absolute; left: 42%; top: 32%; }
#b3 { position: absolute; left: 67%; top: 50%; }
#input1:checked ~ #content1,
#input2:checked ~ #content2,
#input3:checked ~ #content3 { display: block !important; animation: fadein .5s; }
input:checked ~ label .button { display: none !important; animation: fadeout .5s; }
.button:hover { color: #d32f2f; background: white; }
.cta { display: inline-block; background: #d32f2f; color: white; padding: 12px 24px; margin-top: 48px; border-radius: 24px; text-decoration: none; transition: all .3s ease; }
.cta:hover { text-decoration: underline !important; box-shadow: 0 0 0 6px rgba(211, 46, 46, 0.4); }
@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeout {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  from { box-shadow: 0 0 0 0px rgba(211, 47, 47); }
  to { box-shadow: 0 0 0 15px rgba(0, 0, 0, 0); }
}

/* inspired by this article/tutorial > https://curated.email/hotspots-in-email */
              
            
!

JS

              
                
              
            
!
999px

Console