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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="visually-hidden">
    <clipPath id="path-leaf" clipPathUnits="objectBoundingBox"><path d="M0.989,0.131 c-0.108,-0.082,-0.275,-0.131,-0.446,-0.131 c-0.211,0,-0.384,0.074,-0.473,0.202 c-0.042,0.06,-0.065,0.132,-0.069,0.212 c-0.003,0.072,0.009,0.151,0.036,0.237 c0.093,-0.278,0.352,-0.495,0.651,-0.495 c0,0,-0.28,0.074,-0.455,0.301 c0,0,-0.002,0.003,-0.006,0.009 c-0.035,0.047,-0.066,0.101,-0.089,0.162 c-0.039,0.093,-0.075,0.22,-0.075,0.373 h0.125 c0,0,-0.019,-0.119,0.014,-0.257 c0.055,0.007,0.104,0.011,0.148,0.011 c0.115,0,0.197,-0.025,0.258,-0.078 c0.054,-0.048,0.084,-0.112,0.116,-0.18 c0.048,-0.104,0.103,-0.222,0.263,-0.313 c0.009,-0.005,0.015,-0.015,0.016,-0.025 s-0.004,-0.021,-0.012,-0.027"></path></clipPath>
</svg>


<div class="wrapper">
  <h1 class="title">
    Test page of <a href="https://developer.mozilla.org/ru/docs/Web/CSS/clip-path">clip-path</a> properties
  </h1>
  
  <ul class="list">
    <li class="item ">
      <div 
        class="clip-path clip-path--inset"></div>

      <div class="comment">
        <code>
          clip-path: <mark>inset(10% 15%)</mark>;
        </code>
      </div>
    </li>
    
    <li class="item ">
      <div 
        class="clip-path clip-path--inset-round"></div>

      <div class="comment">
        <code>
          clip-path: <mark>inset(10% 15% round 10%)</mark>;
        </code>
      </div>
    </li>

    <li class="item ">
      <div 
        class="clip-path clip-path--circle"></div>

      <div class="comment">
        <code>
          clip-path: <mark>circle(40% at 50% 50%)</mark>;
        </code>
      </div>
    </li>

    <li class="item ">
      <div 
        class="clip-path clip-path--ellipse"></div>

      <div class="comment">
        <code>
          clip-path: <mark>ellipse(50% 30% at 50% 50%)</mark>;
        </code>
      </div>
    </li>

    <li class="item ">
      <div 
        class="clip-path clip-path--polygon"></div>

      <div class="comment">
        <code>
          clip-path: <mark>polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)</mark>;
        </code>
      </div>
    </li>

    <li class="item ">
      <div 
        class="clip-path clip-path--geometry-box"></div>

      <div class="comment">
        <code>
          clip-path: <mark>content-box</mark> circle(40% at 50% 50%);
        </code>

        <s>Chrome</s>
      </div>
    </li>
    
    <li class="item ">
      <div 
        class="clip-path clip-path--svg"></div>

      <div class="comment">
        <code>
          clip-path: <mark>url(#path-leaf)</mark>;
        </code>
      </div>
    </li>
  </ul>
</div>
              
            
!

CSS

              
                HTML {
  font-size: 16px;
}

A {
  color: steelblue;
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;

  clip: rect(0 0 0 0);
  overflow: hidden;
}

.wrapper {
  width: 100%;
  max-width: 700px;
  margin: 3rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.title {
  font-family: Georgia, serif;
  font-weight: normal;
  margin-bottom: 1em;
}

.list {
  padding: 0;
  list-style-type: none;
}

.item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #DDD;
  padding-bottom: 1rem;
  
  & + & {
    margin-top: 1rem;
  }
}

.comment {
  margin-left: 1rem;
  
  CODE {
    display: block;
    margin: 1rem 0;
  }
}

MARK {
  position: relative;
  background: none;
  
  &::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    right: -5px;
    bottom: 0;
    left: -4px;
    background: gold;
    border-radius: 3px;
  }
}

.clip-path {
  width: 100px;
  height: 100px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: linear-gradient(teal, turquoise);
}

.clip-path--inset {
  clip-path: inset(10% 15%);
}

.clip-path--inset-round {
  clip-path: inset(10% 15% round 10%);
}

.clip-path--circle {
  clip-path: circle(40% at 50% 50%);
}

.clip-path--ellipse {
  clip-path: ellipse(50% 30% at 50% 50%);
}

.clip-path--polygon {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.clip-path--geometry-box {
  padding: 20px;
  clip-path: content-box circle(40% at 50% 50%);
}

.clip-path--svg {
  clip-path: url(#path-leaf);
}

              
            
!

JS

              
                
              
            
!
999px

Console