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

              
                

<div class="container">
  <p>Trying out the techniques listed on <a href="https://css-tricks.com/almanac/properties/c/clip/">this CSS Tricks article from back in 2014</a></p>
  <h1>Percentages Only</h1>
  <h2>Regular Image</h2>
  <img class="normalpoly" src="http://via.placeholder.com/350x150" alt="alt" /><h2>GIF Version</h2>
  <img class="normalpoly" src="https://media.giphy.com/media/l4pT4wQxoRvcqFaQE/giphy.gif">
  <h2>Video Embed Even?</h2>
  <p><strike>Nope</strike>. <strike>Yep!</strike> <a href="https://codepen.io/iChris/details/jZyLJB#comment-id-211860">Maybe?</a></p>
  <iframe class="normalpoly" src="https://player.vimeo.com/video/251088034" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
  <h2>Extra Wide Images Mess it Up</h2>
  <img class="normalpoly" src="http://via.placeholder.com/1250x150" alt="alt" />
  <p>Have to figure out a way to get around percentages?</p>
</div>

<div class="container">
  <h1>Trying to Use calc()</h1>
 <img class="calculated" src="http://via.placeholder.com/350x150" alt="alt" /><h2>GIF Version</h2>
  <img class="calculated" src="https://media.giphy.com/media/l4pT4wQxoRvcqFaQE/giphy.gif">
  <h2>Video Embed Even?</h2>
  <p><strike>Nope</strike>. <strike>Yep!</strike> <a href="https://codepen.io/iChris/details/jZyLJB#comment-id-211860">Maybe?</a></p>
  <iframe class="calculated" src="https://player.vimeo.com/video/251088034" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
  <h2>Extra Wide Image</h2>
  <img class="calculated" src="http://via.placeholder.com/1250x150" alt="alt" />
</div>
              
            
!

CSS

              
                .container {
  text-align: center;
  padding-top:40px;
}

.normalpoly { 
  -webkit-clip-path: polygon(100% 0, 100% 60%, 80% 100%, 0 100%, 0 0); /* Probably can get rid of the webkit version in 2018 but I copy/paste 'em like I see 'em.  */
clip-path: polygon(100% 0, 100% 60%, 80% 100%, 0 100%, 0 0);
}

.calculated {
  -webkit-clip-path: polygon(100% 0, 100% calc(100% - 50px), calc(100% - 20px) 100%, 0 100%, 0 0);
  clip-path: polygon(100% 0, 100% calc(100% - 50px), calc(100% - 20px) 100%, 0 100%, 0 0);
}


              
            
!

JS

              
                
              
            
!
999px

Console