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

Auto Save

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

              
                <div class="btn btn1">I'm a button
  <svg class="border">
    <path d="M 0,0 L 200,0 L 200,40 L 0,40 Z" fill="none"></path>
  </svg>
</div>
<div class="btn btn2">Me Too
  <svg class="border">
    <path d="M 0,40 L 200,40 L 200,0 L 0,0 Z" fill="none"></path>
  </svg>
</div>
<div class="btn btn3">Me Too Too
  <svg class="border">
    <path d="M 0,40 L 200,40 L 200,0 L 0,0 Z" fill="none"></path>
  </svg>
</div>
<div class="btn btn4">Me Tooo
  <svg class="border">
    <path d="M 0,40 L 200,40 L 200,0 L 0,0 Z" fill="none"></path>
  </svg>
</div>
<div class="btn btn5">
  <svg class="border">
    <defs> 
      <linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
        <stop offset="0%" stop-color="#e4d68b"/>
        <stop offset="100%" stop-color="#c69158"/> 
      </linearGradient>
    </defs>
    <rect class="bg" x="0" y="0" rx="20" ry="20" width="200" height="40"/>
  </svg>
  <span>Me Toooo</span>
</div>
<div class="btn btn6">
  <svg class="border">
    <path class="path" d="
      M 20,39
      A 19 19 0 1 1 20 1
      A 19 19 0 1 1 20 39"
      ></path>
  </svg>
</div>
<div class="btn btn7"><span>MTT</span>
  <svg class="border" viewbox="-10 -10 220 220">
    <path d="M 100,0 L 186,50 L 186,150 L 100,200 L 13,150 L 13,50 Z" fill="none"></path>
  </svg>
</div>

              
            
!

CSS

              
                html, body {
  height: 100%;
  background-color: #333;
  overflow: hidden;
  text-align: center;
}

.btn {
  position: relative;
  display: inline-block;
  margin: 0 50px;
  margin-top: 100px;
  width: 200px;
  height: 40px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
  color: #e4d68b;
  overflow: hidden;
  cursor: pointer;
}

.btn1 
  .border
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    stroke: #e4d68b;
    stroke-width: 6px;
    stroke-dashoffset: 20;
    stroke-dasharray: 40 200;
    transition: all 0.4s;
   &:hover
    .border
      stroke-dashoffset: 0;
      stroke-dasharray: 240 0;

.btn2 
  .border
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    stroke: #e4d68b;
    stroke-width: 6px;
    stroke-dashoffset: -100;
    stroke-dasharray: 0 480;
    transition: all 0.4s;
   &:hover
    .border
      stroke-dashoffset: 140;
      stroke-dasharray: 480 0;

.btn3
  .border
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    stroke: #e4d68b;
    stroke-width: 2px;
    stroke-dashoffset: 0;
    stroke-dasharray: 3 3;
    animation: re .2s infinite linear;

@keyframes re {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 6;
  }
}

.btn4
  box-shadow: 0 0 0 3px rgba(228, 214, 139, .1) inset;
  .border
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    stroke: #e4d68b;
    stroke-width: 6px;
    stroke-dashoffset: 0;
    stroke-dasharray: 3 237;
    transition: all 0.4s;
   &:hover
    .border
      stroke-dashoffset: 0;
      stroke-dasharray: 200 40;

.btn5 
  .border
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    .bg
      stroke: url(#linear);
      stroke-width: 6px;
      fill: transparent;
  span
    position: relative;
    display: inline-block;
    color: #e4d68b;
    background-image: -webkit-gradient(linear, 0 0, 0 bottom, from(#e4d68b), to(#c69158));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
   &:hover
    span
      animation: btn5Move .5s linear;
      @keyframes btn5Move
        0%, 100%{transform: translatey(0);}
        33%{transform: translatey(-40px);opacity: 0;}
        66%{transform: translatey(40px);opacity: 0;}
        100%{transform: translatey(0);opacity: 1;}

.btn6
  &::before
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-left: 2px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 10px;
    border-color: transparent transparent transparent #e4d78b;
  .border
    width: 40px;
    height: 40px;
    stroke: #e4d68b;
    stroke-width: 1px;
    stroke-dashoffset: 0;
    stroke-dasharray: 18 12;
    fill: transparent;
    stroke-linecap: round;
    animation: b6re 2s linear infinite;
    @keyframes b6re
      from
        transform: rotate(0)
      to
        transform: rotate(360deg)

.btn7
  width 100px
  height 100px
  span
    display block
    position absolute
    top 50%
    left 50%
    transform translate(-50%,-50%)
  .border
    position absolute
    top 0
    left 0
    width 100%
    height 100%
    stroke #e4d68b
    stroke-width 6px
    stroke-dashoffset 75
    stroke-dasharray 50 250
    transition all 0.4s
   &:hover
     .border
       stroke-dashoffset 200
       stroke-dasharray 300 0
              
            
!

JS

              
                
              
            
!
999px

Console