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 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

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

              
                <svg class="svg-defs">
  <defs>
        <clipPath id="clipping">
          <polygon id="Star-1" points="98.4999978 153.75 38.2520165 185.424245 49.7583542 118.337123 1.01670635 70.8257603 68.3760155 61.037872 98.5000012 1.1379786e-14 128.624005 61.0378871 195.98331 70.8258091 147.241642 118.337136 158.747982 185.424247"/>
        </clipPath>
    </def>
</svg>
<svg class="svg-defs">
  <defs>
    <clipPath id="triangle" clipPathUnits="objectBoundingBox">
    <polygon points="0 0.87, 0.5 0, 0.5 0, 1 0.87" />
    </clipPath>
 </defs>
</svg>
<svg class="svg-defs">
  <defs>
    <clipPath id="circle">
      <circle cx="100" cy="100" r="100"/>
    </clipPath>
  </defs>
</svg>

<div class="clip-img star">
  <svg width="250" height="250">
        <image xlink:href="https://placekitten.com/g/500/500" width="250" height="250" />
    </svg>
</div>

<div class="clip-img circle">
   <svg width="250" height="250">
        <image xlink:href="https://placekitten.com/g/500/500" width="250" height="250" />
    </svg>
</div>

<div class="clip-img triangle">
    <svg width="250" height="250">
        <image xlink:href="https://placekitten.com/g/500/500" width="250" height="250" />
    </svg>
</div>
              
            
!

CSS

              
                body {
  max-width: 70rem;
  margin: 0 auto;
  padding: 5rem;
  background: #dedede;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.clip-img {
  margin:0 3rem;
  display: inline-block;
  text-align: 
  img {
    float: none;
    margin: 0 auto;
    text-align: center;
    display: inline-block;
    width: 250px;
    height: 250px;
    }
  &.star image {
    clip-path: url(#clipping);
  }
   &.triangle image {
    clip-path: url(#triangle);
  }
  &.circle image {
    clip-path: url(#circle);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console