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

              
                <header class="header">
  <div class="header__title">
    <h1>
      <code>ellipse()</code>
    </h1>
  </div>
  <div class="header__reference">
    <ul class="reference-list">
      <li><a class="reference-list__link" href="https://developer.mozilla.org/en-US/docs/Web/CSS/basic-shape">MDN reference</a></li>
      <li><a class="reference-list__link" href="https://caniuse.com/#feat=css-clip-path">caniuse Support</a></li>
    </ul>
  </div>
</header>

<main>
  <div class="example">
    <p>
      In this example, we have an <code>img</code> element with a class of <code>ellipse</code> applied to it. A <code>clip-path</code> property is applied to the <code>ellipse</code> class, allowing us to create an oval. 
    </p>
    <p>
      The <code>ellipse()</code> function argument used for <code>clip-path</code> sets the oval's width and height to be <code>30vw</code> and <code>16vw</code>, respectively. This width and height radiates out from central point set to <code>50%</code> the image's width and <code>60%</code> the image's height.
    </p>

    <div class="example__demo example__demo--ellipse">
      <img 
        class="ellipse"
        alt="Jay Gatsby from the 2013 movie, The Great Gatsby, staring out at you, the viewwer and holding out a glass as a toast. Fireworks are exploding in the background. An ellipse effect has been applied, making the image an oval shape instead of a rectangle."
        src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/great-gatsby-cheers.jpg" />
    </div>

    <p>
      Note that the padding around the image means the browser is still including the image's height and width when calculating its size. Here, it is rendering anything that does not have a mask applied to it as transparent instead of removing it from the rendered page.
    </p>
  </div>
</main>
              
            
!

CSS

              
                // Demo
.ellipse {
  clip-path: ellipse(30vw 16vw at 50% 60%);
}


// Pen Setup
.example__demo--ellipse {
  background-color: var(--color-cinder);
  padding: 0;
  
  img {
    height: auto;
    width: 100%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console