css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              <h2>From left to right</h2>
<a href="#" class="btn btn-small btn-l-r">btn small</a>
<a href="#" class="btn btn-medium btn-l-r">btn medium</a>
<a href="#" class="btn btn-large btn-l-r">btn large</a>
<a href="#" class="btn btn-huge btn-l-r">btn huge</a>

<h2>From right to left</h2>
<a href="#" class="btn btn-small btn-r-l">btn small</a>
<a href="#" class="btn btn-medium btn-r-l">btn medium</a>
<a href="#" class="btn btn-large btn-r-l">btn large</a>
<a href="#" class="btn btn-huge btn-r-l">btn huge</a>

<h2>From top to bottom</h2>
<a href="#" class="btn btn-small btn-t-b">btn small</a>
<a href="#" class="btn btn-medium btn-t-b">btn medium</a>
<a href="#" class="btn btn-large btn-t-b">btn large</a>
<a href="#" class="btn btn-huge btn-t-b">btn huge</a>

<h2>From bottom to top</h2>
<a href="#" class="btn btn-small btn-b-t">btn small</a>
<a href="#" class="btn btn-medium btn-b-t">btn medium</a>
<a href="#" class="btn btn-large btn-b-t">btn large</a>
<a href="#" class="btn btn-huge btn-b-t">btn huge</a>

<h2>ِAnimated border</h2>
<a href="#" class="btn btn-small btn-animated-border">btn small</a>
<a href="#" class="btn btn-medium btn-animated-border">btn medium</a>
<a href="#" class="btn btn-large btn-animated-border">btn large</a>
<a href="#" class="btn btn-huge btn-animated-border">btn huge</a>

<h2>ِRotate top left </h2>
<a href="#" class="btn btn-small btn-rotate rotate-t-l">btn small</a>
<a href="#" class="btn btn-medium btn-rotate rotate-t-l">btn medium</a>
<a href="#" class="btn btn-large btn-rotate rotate-t-l">btn large</a>
<a href="#" class="btn btn-huge btn-rotate rotate-t-l">btn huge</a>


<h2>ِRotate top right </h2>
<a href="#" class="btn btn-small btn-rotate rotate-t-r">btn small</a>
<a href="#" class="btn btn-medium btn-rotate rotate-t-r">btn medium</a>
<a href="#" class="btn btn-large btn-rotate rotate-t-r">btn large</a>
<a href="#" class="btn btn-huge btn-rotate rotate-t-r">btn huge</a>

<h2>ِRotate bottom left </h2>
<a href="#" class="btn btn-small btn-rotate rotate-b-l">btn small</a>
<a href="#" class="btn btn-medium btn-rotate rotate-b-l">btn medium</a>
<a href="#" class="btn btn-large btn-rotate rotate-b-l">btn large</a>
<a href="#" class="btn btn-huge btn-rotate rotate-b-l">btn huge</a>

<h2>ِRotate bottom right </h2>
<a href="#" class="btn btn-small btn-rotate rotate-b-r">btn small</a>
<a href="#" class="btn btn-medium btn-rotate rotate-b-r">btn medium</a>
<a href="#" class="btn btn-large btn-rotate rotate-b-r">btn large</a>
<a href="#" class="btn btn-huge btn-rotate rotate-b-r">btn huge</a>

<h2>Shadow from bottom</h2>
<a href="#" class="btn btn-small btn-shadow">btn small</a>
<a href="#" class="btn btn-medium btn-shadow">btn small</a>
<a href="#" class="btn btn-large btn-shadow">btn small</a>
<a href="#" class="btn btn-huge btn-shadow">btn small</a>

            
          
!
            
              /**** Variables ****/
@blue: #2196F3;
@green: #4CAF50;
@pink: #E91E63;
@purple: #9C27B0;
@cyan : #00BCD4;
@teal: #009688;
@red: #F44336;
@white : #fff;
body {
  margin: 50px;
  text-align: center;
  font-family: 'Ubuntu', sans-serif; 
}
h2 {
  margin: 30px 0;
}
.btn {
  position: relative;
  background: transparent;
  display: inline-block;
  text-decoration: none;
  border: 1px solid;
  border-radius: 4px;
  margin-right: 20px;
  transition: 0.3s;
  &:after {
      content: "";
      position: absolute;
      border-radius: 4px;
      transition: 0.3s;
      z-index: -1;
      background: transparent;
  }
  &:before {
      content: "";
      position: absolute;
  }
}
/**** from left to right style ****/
.btn-l-r {
  color: @blue;
  border-color: @blue;
  &:hover {
    color: @white;
  }
  &:hover:after {
    background: @blue;
    width: 100%;
  }
  &:after {
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
  }
}

/**** from right to left style ****/
.btn-r-l {
  color: @green;
  border-color: @green;
  &:hover {
    color: @white;
  }
  &:hover:after {
    background: @green;
    width: 100%;
  }
    &:after {
      top: 0;
      right: 0;
      width: 0%;
      height: 100%;
    }
}

/**** from top to bottom style ****/
.btn-t-b {
  color: @pink;
  border-color: @pink;
  &:hover {
    color: @white;
  }
  &:hover:after {
    background: @pink;
    height: 100%;
  }
    &:after {
      top: 0;
      left: 0;
      width: 100%;
      height: 0%;
    }
}

/**** from bottom to top style ****/
.btn-b-t {
  color: @purple;
  border-color: @purple;
  &:hover {
    color: @white;
  }
  &:hover:after {
    background: @purple;
    height: 100%;
  }
    &:after {
      bottom: 0;
      left: 0;
      width: 100%;
      height: 0%;
    }
}

/**** Animated border ****/
.btn-animated-border {
  color: @cyan;
  &:hover {
    color: darken(@cyan, 10%);
  }
  &:after {
    top: -1px;
    left: 0;
    width: 0%;
    height: 100%;
    border-width: 1px 0 1px 0;
    border-style: solid;
    border-color: darken(@cyan, 10%);
  }
  &:hover:after {
    width: 100%;
  }
  &:before {
    top: 0;
    left: -1px;
    width: 100%;
    height: 0%;
    background: transparent;
    border-width: 0 1px 0 1px;
    border-style: solid;
    border-color: darken(@cyan, 10%);
    border-radius: 4px;
    transition: 0.3s;
  }
  &:hover:before {
    height: 100%;
  }
}

/**** General rotate style ****/
.btn-rotate {
  color: @teal;
  overflow: hidden;
  transition: 0.3s;
  &:after {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: @teal;
  }
  &:hover {
    color: @white;
    border-color: @teal;
  }
  &:hover:after {
    transform: rotate(0deg);
  }
}
/**** Rotate top left ****/
.rotate-t-l {
  color: @teal;
  overflow: hidden;
  transition: 0.3s;
  &:after {
    transform: rotate(-90deg);
    transform-origin: top left;
  }
}

/**** Rotate top right ****/
.rotate-t-r {
  &:after {
    transform: rotate(90deg);
    transform-origin: top right;
  }
}

/**** Rotate bottom left ****/
.rotate-b-l {
  &:after {
    transform: rotate(90deg);
    transform-origin: bottom left;
  }
  
}

/**** Rotate bottom right ****/
.rotate-b-r {
  &:after {
    transform: rotate(-90deg);
    transform-origin: bottom right;
  }
}

/**** Button Shadow from bottom ****/
.btn-shadow {
  background: @pink;
  border: none;
  color: @white;
  border-radius: 0;
  overflow: hidden;
  &:after {
    top: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    background: darken(@pink, 7%);
    border-radius: 0;
  }
  &:hover:after {
    top: 90%;
  }
}

.btn-small {
  padding: 2px 7px;
}
.btn-medium {
  padding: 7px 13px;
}
.btn-large {
  padding: 12px 18px;
}
.btn-huge {
  padding: 18px 25px;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console