<a class="addtocart" href='javascript:if (typeof qty == "undefined") {qty = 0}; document.getElementsByClassName("qty")[0].innerHTML = ++qty;'></a><span class="qty">0</span>
<link href='https://fonts.googleapis.com/css?family=Cabin' rel='stylesheet' type='text/css'>
body {
    line-height:1;
}
.addtocart {
    text-decoration:none;
    border-radius:3px;
    box-shadow:1px 1px 2px #999;
    border:1px solid #BF431B;
    color:#fff;
    text-shadow:0 1px 2px #902006;
    font-weight:bold;
    font-family:'Cabin',sans-serif;
    font-size:12px;
    background:#F3662B;
    cursor:pointer;
    position: relative;
    height:30px;
    width:91px;
    display:block;
    transition:width 0s, border-radius 0s, background .2s;
    transition-delay:.2s, .2s, 0s;
    z-index:1;
}
.addtocart:after {
    width:90px;
    margin-top:9px;
    display:block;
    position:absolute;
    content:"Add to cart";
    text-align:center;
    left:0;
    top:0;
}
.addtocart + .qty {
    position: relative;
    left:45px;
    top:-29px;
    display:block;
    background:#eee;
    box-shadow: inset 0 1px 2px #cdcdcd;
    border:1px solid #aaa;
    padding:6px 0px;
    width:35px;
    text-align:center;
    text-shadow: none;
    font-weight:normal;
    color:black;
    transition:left .2s;
    font-family:'Cabin',sans-serif;
    font-size:12px;
}
.addtocart:hover + .qty {
    left:81px;
    transition:left .2s;
}
.addtocart:before {
    content:"";
    display:block;
    position: absolute;
    left:80px;
    top:-1px;
    width:11px;
    height:30px;
    background:#F3662B;
    border-radius:0 3px 3px 0;
    border:1px solid #BF431B;
    border-left-width:0;
    transition:left .2s, border-left-width .2s, box-shadow 0s;
    transition-delay:0s, 0s, .2s;
}
.addtocart:hover {
    border-radius:3px 0 0 3px;
    width:80px;
    background:#FF763B;
    transition:width 0s, border-radius 0s, background .3s;
}
.addtocart:hover:before {
    left:115px;
    border-left-width:1px;
    box-shadow:1px 1px 2px #999;
    background:#FF763B;
    transition:left .2s, border-left-width .2s, box-shadow 0s, background .3s;
}

.addtocart:active,
.addtocart:active:before {
    background:#A41;
    transition:background .1s;
}
.addtocart:active + .qty {
    color:#555;
    transition:color .0s;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.