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

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

              
                <button class="corners-wrapper">
  <div class="corners top side"></div>
  <div>hover me!</div>
</button>

<button class="corners-wrapper">
  <div class="corners top pink"></div>
  <div>or me!</div>
</button>

<button class="corners-wrapper">
  <div class="corners side blue"></div>
  <div>cool, eh?</div>
</button>
              
            
!

CSS

              
                body {
  font-family: sans-ser9f;
  --background: white;
  background: var(--background);
  font-size: 18px;
  padding-top: 100px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

button.corners-wrapper {
  /* Reset all the things */
  border: none;
  box-shadow: none;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  /* Some custom styles */
  display: inline-block;
  padding: 16px;
  margin: 4px 8px;
  /* This bit is the only important one */
  position: relative;
}

.corners {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  --border-size: 2px;
  border: var(--border-size) solid black;
  transition: transform 0.2s;
}

.corners:hover, button.corners-wrapper:focus .corners {
  transform: scale(1.1);
}

/* 
 * These are the top/bottom corners.
 * Comment this out if you don't want them.
*/
.corners.top:before {
  content: '';
  position: absolute;
  /* Change this to control the size of the corners. */
  left: 15%;
  width: 70%;
  /* Thick enough to cover the box border. */
  top: calc(-2 * var(--border-size));
  bottom: calc(-2 * var(--border-size));
  border-top: calc(4 * var(--border-size)) solid var(--background);
  border-bottom: calc(4 * var(--border-size)) solid var(--background);
}

/* 
 * These are the left/right corners.
 * Comment this out if you don't want them.
*/
.corners.side:after {
  content: '';
  position: absolute;
  /* Change this to control the size of the corners. */
  top: 15%;
  height: 70%;
  /* Thick enough to cover the box border */
  left: calc(-2 * var(--border-size));
  right: calc(-2 * var(--border-size));
  border-left: calc(4 * var(--border-size)) solid var(--background);
  border-right: calc(4 * var(--border-size)) solid var(--background);
}

.pink {
  border-color: hotpink;
}

.blue {
  border-color: blue;
}
              
            
!

JS

              
                
              
            
!
999px

Console