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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div class="center">

  <h1>Cool Button</h1>

  <a href="#" class="button">
    <div class="bottom"></div>
    <div class="top">
      <div class="label">Click Me (1)</div>
      <div class="button-border button-border-left"></div>
      <div class="button-border button-border-top"></div>
      <div class="button-border button-border-right"></div>
      <div class="button-border button-border-bottom"></div>
    </div>
  </a>

  <a href="#" class="button2">Click Me (2)</a>

  <p>Above you can see the button (Click Me 1) with all effects visible, like the changing of color (transition) of the 4 seperate borders. The other button (Cick Me 2) is the simple version, coded with :before pseudo-element, big difference is that I'm using outline here instead of border in the first example above. 
  
  <p>This 2nd version though is way easier to embed in a CMS with dynamical input and easier to maintain. I had to code the 2nd button with outline to maintain the visual effect of overlapping. If you use the border property in the 2nd button the (orange) background would overlap the border. Below you can see both buttons on a background (that can also be an image or something else).

  <div class="background">

    <a href="#" class="button">
      <div class="bottom"></div>
      <div class="top">
        <div class="label">Click Me (1)</div>
        <div class="button-border button-border-left"></div>
        <div class="button-border button-border-top"></div>
        <div class="button-border button-border-right"></div>
        <div class="button-border button-border-bottom"></div>
      </div>
    </a>

    <a href="#" class="button2">Click Me (2)</a>

  </div>

</div>
            
          
!

CSS

            
              *,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.center {
  text-align: center;
}

p { line-height: 140%; }
.background {
  background: rgba(0,0,0,.4);
}
.button {
  display: inline-block;
  text-decoration: none;
  position: relative;
  margin: 40px 12px;
  z-index: 0;
  transition: background .3s ease;
}
.button .bottom {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 100%;
  height: 100%;
  background-color: #ed9121;
  display: block;
  -webkit-transition: all 0.15s ease-out;
  -moz-transition: all 0.15s ease-out;
  -o-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
}
.button .top .label {
  font-family: sans-serif;
  font-weight: 400;
  color: #FFF;
  font-size: 12px;
  line-height: 110%;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  -webkit-transition: all 0.15s ease-out;
  -moz-transition: all 0.15s ease-out;
  -o-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
}
.button-border {
  position: absolute;
  background-color: #ceab6a;
  -webkit-transition: all 0.25s ease-out;
  -moz-transition: all 0.25s ease-out;
  -o-transition: all 0.25s ease-out;
  transition: all 0.25s ease-out;
}
.button-border-left {
  left: -2px;
  bottom: -2px;
  width: 2px;
  height: 0;
}
.button-border-top {
  left: -2px;
  top: -2px;
  width: 0;
  height: 2px;
}
.button-border-right {
  right: -2px;
  top: -2px;
  width: 2px;
  height: 0;
}
.button-border-bottom {
  right: -2px;
  bottom: -2px;
  width: 0;
  height: 2px;
}
.button .top {
  position: relative;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 24px 34px 22px 34px;
  border: 2px solid #0c4a45;
}

.button:hover .bottom {
  left: 0;
  top: 0;
  background-color: #f3f3f3;
}
.button-dark:hover .bottom {
  background-color: #111;
  background-color: rgba(17, 17, 17, 0.8);
}
.button:hover .top .label {
  color: #0c4a45;
}
.button-border {
  position: absolute;
  background-color: #ed9121;
  -webkit-transition: all 0.25s ease-out;
  -moz-transition: all 0.25s ease-out;
  -o-transition: all 0.25s ease-out;
  transition: all 0.25s ease-out;
}
.button:hover .top .button-border-left,
.button:hover .top .button-border-right {
  height: calc(100% + 2px);
}
.button:hover .top .button-border-top,
.button:hover .top .button-border-bottom {
  width: calc(100% + 2px);
}


.button2 {
  display: inline-block;
  text-decoration: none;
  position: relative;
  margin: 40px 0;
  padding: 24px 34px 22px 34px;
  outline: 3px solid #0c4a45;
  font-family: sans-serif;
  font-weight: 400;
  color: #FFF;
  font-size: 12px;
  line-height: 110%;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  -webkit-transition: all 0.15s ease-out;
  -moz-transition: all 0.15s ease-out;
  -o-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
  z-index: 1;
}

.button2:before {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  background-color: #ed9121;
  display: block;
  z-index: -1;
  -webkit-transition: all 0.15s ease-out;
  -moz-transition: all 0.15s ease-out;
  -o-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
}

.button2:hover {
  color: #000;
  border-color: #ed9121;
}
.button2:hover:before {
  top: 0;
  left: 0;
  background: #FFF;
}

h1 {
  margin: 24px 5% 32px;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}
p {
  margin: 0 5% 24px;
}
            
          
!

JS

            
              
            
          
!
999px

Console