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

              
                <div class="centerer">
  <h1>Just Some More</h1>
  <h1>Button Hover Effects</h1>


  <div class="wrap">
    <a class="btn-0" href="#">Swipe</a>
    <a class="btn-1" href="#">Diagonal Swipe</a>
    <a class="btn-1-2" href="#">Double Swipe</a>
    <a class="btn-2" href="#">Diagonal Close</a>
    <a class="btn-3" href="#"><span>Zoning In</span></a>
    <a class="btn-4" href="#"><span>4 Corners</span></a>
    <a class="btn-5" href="#">Slice</a>
  </div>
  <div class="wrap">
    <a class="btn-6" href="#">Position Aware<span></span></a>
    <a class="btn-7" href="#"><span>Alternate</span></a>
    <a class="btn-8" href="#">Smoosh</a>
    <a class="btn-9" href="#"><span>Vertical Overlap</span></a>
    <a class="btn-10" href="#"><span>Horizontal Overlap</span></a>
    <a class="btn-11" href="#">Collision</a>
  </div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Open+Sans:400|Raleway:300);
html {
  padding-top: 50px;
  font-family: 'Open Sans', Helvetica, arial, sans-serif;
  text-align: center;
  background-color: #eeeeee;
}
html *,
html *:before,
html *:after {
  box-sizing: border-box;
  -webkit-transition: 0.5s ease-in-out;
  transition: 0.5s ease-in-out;
}
html i, html em,
html b, html strong,
html span {
  -webkit-transition: none;
  transition: none;
}

*:before,
*:after {
  z-index: -1;
}

h1,
h4 {
  font-family: 'Raleway', 'Open Sans', sans-serif;
  margin: 0;
  line-height: 1;
}

a {
  text-decoration: none;
  line-height: 80px;
  color: black;
}

.centerer {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 600px) {
  .wrap {
    width: 50%;
    float: left;
  }
}
[class^="btn-"] {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 80px;
  max-width: 250px;
  margin: 1rem auto;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.btn-0 {
  color: #b3be7c;
}
.btn-0:before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #636b3d;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.btn-0:hover {
  color: #e9ecd9;
}
.btn-0:hover:before {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}

.btn-1 {
  color: #a67aa1;
}
.btn-1:before {
  content: '';
  position: absolute;
  top: 0;
  right: -50px;
  bottom: 0;
  left: 0;
  border-right: 50px solid transparent;
  border-bottom: 80px solid #5a3b56;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.btn-1:hover {
  color: #e5d8e3;
}
.btn-1:hover:before {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}

.btn-1-2 {
  color: #6c8c6d;
}
.btn-1-2:before, .btn-1-2:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-bottom: 80px solid #314832;
}
.btn-1-2:before {
  right: -50px;
  border-right: 50px solid transparent;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.btn-1-2:after {
  left: -50px;
  border-left: 50px solid transparent;
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
}
.btn-1-2:hover {
  color: #d4ddd4;
}
.btn-1-2:hover:before {
  -webkit-transform: translateX(-40%);
          transform: translateX(-40%);
}
.btn-1-2:hover:after {
  -webkit-transform: translateX(40%);
          transform: translateX(40%);
}

.btn-2 {
  color: #30a6ac;
}
.btn-2:before, .btn-2:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.btn-2:before {
  right: -50px;
  border-right: 50px solid transparent;
  border-bottom: 80px solid #075a5e;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.btn-2:after {
  left: -50px;
  border-left: 50px solid transparent;
  border-top: 80px solid #075a5e;
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
}
.btn-2:hover {
  color: #c2e5e7;
}
.btn-2:hover:before {
  -webkit-transform: translateX(-49%);
          transform: translateX(-49%);
}
.btn-2:hover:after {
  -webkit-transform: translateX(49%);
          transform: translateX(49%);
}

.btn-3:before, .btn-3:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 40px solid #770c78;
  border-bottom: 40px solid #770c78;
}
.btn-3:before {
  border-right: 40px solid transparent;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.btn-3:after {
  border-left: 40px solid transparent;
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
}
.btn-3:hover {
  color: #f1c4f1;
}
.btn-3:hover:before {
  -webkit-transform: translateX(-30%);
          transform: translateX(-30%);
}
.btn-3:hover:after {
  -webkit-transform: translateX(30%);
          transform: translateX(30%);
}

.btn-4 {
  color: #52ada8;
}
.btn-4:before, .btn-4:after,
.btn-4 span:before,
.btn-4 span:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #1f5f5c;
}
.btn-4:before {
  -webkit-transform: translate(-100%, -100%);
          transform: translate(-100%, -100%);
}
.btn-4:after {
  -webkit-transform: translate(-100%, 100%);
          transform: translate(-100%, 100%);
}
.btn-4 span:before {
  -webkit-transform: translate(100%, -100%);
          transform: translate(100%, -100%);
}
.btn-4 span:after {
  -webkit-transform: translate(100%, 100%);
          transform: translate(100%, 100%);
}
.btn-4:hover {
  color: #cce7e6;
}
.btn-4:hover:before {
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
.btn-4:hover:after {
  -webkit-transform: translate(-50%, 50%);
          transform: translate(-50%, 50%);
}
.btn-4:hover span:before {
  -webkit-transform: translate(50%, -50%);
          transform: translate(50%, -50%);
}
.btn-4:hover span:after {
  -webkit-transform: translate(50%, 50%);
          transform: translate(50%, 50%);
}

.btn-5 {
  color: #645678;
}
.btn-5:after {
  content: '';
  width: 0;
  height: 0;
  -webkit-transform: rotate(360deg);
  border-style: solid;
  border-width: 0 0 0 0;
  border-color: transparent #2c223a transparent transparent;
  position: absolute;
  top: 0;
  right: 0;
}
.btn-5:before {
  content: '';
  width: 0;
  height: 0;
  -webkit-transform: rotate(360deg);
  border-style: solid;
  border-width: 0 0 0 0;
  border-color: transparent transparent transparent #2c223a;
  position: absolute;
  bottom: 0;
  left: 0;
}
.btn-5:before, .btn-5:after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 0 solid;
  -webkit-transform: rotate(360deg);
          transform: rotate(360deg);
}
.btn-5:before {
  bottom: 0;
  left: 0;
  border-color: transparent transparent transparent #2c223a;
}
.btn-5:after {
  top: 0;
  right: 0;
  border-color: transparent #2c223a transparent transparent;
}
.btn-5:hover {
  color: #d2cdd7;
}
.btn-5:hover:before, .btn-5:hover:after {
  border-width: 80px 262.5px;
}

.btn-6 {
  color: #4d9c82;
}
.btn-6 span {
  position: absolute;
  display: block;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: #1b5341;
  -webkit-transition: width 0.4s ease-in-out, height 0.4s ease-in-out;
  transition: width 0.4s ease-in-out, height 0.4s ease-in-out;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  z-index: -1;
}
.btn-6:hover {
  color: #cbe2da;
}
.btn-6:hover span {
  width: 225%;
  height: 562.5px;
}
.btn-6:active {
  background-color: #2d8a6c;
}

.btn-7 {
  color: #4d2b70;
}
.btn-7:before, .btn-7:after,
.btn-7 span:before,
.btn-7 span:after {
  content: '';
  position: absolute;
  top: 0;
  width: 25.25%;
  height: 0;
  background-color: #1b0334;
}
.btn-7:before {
  left: 0;
}
.btn-7:after {
  left: 50%;
}
.btn-7 span:before, .btn-7 span:after {
  top: auto;
  bottom: 0;
}
.btn-7 span:before {
  left: 25%;
}
.btn-7 span:after {
  left: 75%;
}
.btn-7:hover {
  color: #cbc1d5;
}
.btn-7:hover:before, .btn-7:hover:after,
.btn-7:hover span:before,
.btn-7:hover span:after {
  height: 80px;
}

.btn-8 {
  color: #ccac4a;
}
.btn-8:before, .btn-8:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #755e19;
}
.btn-8:before {
  -webkit-transform: translateY(-100%);
          transform: translateY(-100%);
}
.btn-8:after {
  -webkit-transform: translateY(100%);
          transform: translateY(100%);
}
.btn-8:hover {
  color: #f0e7ca;
}
.btn-8:hover:before {
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
}
.btn-8:hover:after {
  -webkit-transform: translateY(50%);
          transform: translateY(50%);
}

.btn-9 {
  color: #739cad;
}
.btn-9:before, .btn-9:after,
.btn-9 span:before,
.btn-9 span:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: rgba(54, 83, 95, 0.25);
  -webkit-transition: 0.4s ease-in-out;
  transition: 0.4s ease-in-out;
}
.btn-9:after,
.btn-9 span:before {
  top: auto;
  bottom: 0;
}
.btn-9 span:before,
.btn-9 span:after {
  -webkit-transition-delay: 0.4s;
          transition-delay: 0.4s;
}
.btn-9:hover {
  color: #d6e2e7;
}
.btn-9:hover:before, .btn-9:hover:after,
.btn-9:hover span:before,
.btn-9:hover span:after {
  height: 80px;
}
.btn-9:active {
  background-color: #5a8a9f;
}

.btn-10 {
  color: #b977c9;
}
.btn-10:before, .btn-10:after,
.btn-10 span:before,
.btn-10 span:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 80px;
  background-color: rgba(104, 57, 115, 0.25);
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
.btn-10:after,
.btn-10 span:before {
  left: auto;
  right: 0;
}
.btn-10 span:before,
.btn-10 span:after {
  -webkit-transition-delay: 0.4s;
          transition-delay: 0.4s;
}
.btn-10:hover {
  color: #ebd7ef;
}
.btn-10:hover:before, .btn-10:hover:after,
.btn-10:hover span:before,
.btn-10:hover span:after {
  width: 250px;
}
.btn-10:active {
  background-color: #ad5fbf;
}

@-webkit-keyframes criss-cross-left {
  0% {
    left: -20px;
  }
  50% {
    left: 50%;
    width: 20px;
    height: 20px;
  }
  100% {
    left: 50%;
    width: 375px;
    height: 375px;
  }
}

@keyframes criss-cross-left {
  0% {
    left: -20px;
  }
  50% {
    left: 50%;
    width: 20px;
    height: 20px;
  }
  100% {
    left: 50%;
    width: 375px;
    height: 375px;
  }
}
@-webkit-keyframes criss-cross-right {
  0% {
    right: -20px;
  }
  50% {
    right: 50%;
    width: 20px;
    height: 20px;
  }
  100% {
    right: 50%;
    width: 375px;
    height: 375px;
  }
}
@keyframes criss-cross-right {
  0% {
    right: -20px;
  }
  50% {
    right: 50%;
    width: 20px;
    height: 20px;
  }
  100% {
    right: 50%;
    width: 375px;
    height: 375px;
  }
}
.btn-11 {
  position: relative;
  color: #29b27a;
}
.btn-11:before, .btn-11:after {
  position: absolute;
  top: 50%;
  content: '';
  width: 20px;
  height: 20px;
  background-color: #03a463;
  border-radius: 50%;
}
.btn-11:before {
  left: -20px;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
.btn-11:after {
  right: -20px;
  -webkit-transform: translate(50%, -50%);
          transform: translate(50%, -50%);
}
.btn-11:hover {
  color: #c0e8d8;
}
.btn-11:hover:before {
  -webkit-animation: criss-cross-left 0.8s both;
          animation: criss-cross-left 0.8s both;
  -webkit-animation-direction: alternate;
          animation-direction: alternate;
}
.btn-11:hover:after {
  -webkit-animation: criss-cross-right 0.8s both;
          animation: criss-cross-right 0.8s both;
  -webkit-animation-direction: alternate;
          animation-direction: alternate;
}

              
            
!

JS

              
                
              
            
!
999px

Console