<a href="#">
<span class="text">Hover Over Me</span>
<span class="btnBefore"></span>
<span class="btnAfter"></span>
</a>
body {
padding: 10px;
background: #f6f6f6;
color: #000;
font-size: 24px;
font-family: arial;
}
a {
float: left;
border-radius: 5px;
margin-top: 10px;
position: relative;
z-index: 1;
overflow: hidden;
min-width: 50px;
display: table;
padding: 5px 10px;
border: none;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-ms-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
text-align: center;
color: #777;
text-decoration: none;
}
a:hover {
background-color: #f1f1f1 !important;
}
span {
position: relative;
z-index: 1;
line-height: 24px;
transition: 0.3s ease;
-webkit-transition: 0.3s ease;
-moz-transition: 0.3s ease;
-o-transition: 0.3s ease;
-ms-transition: 0.3s ease;
}
a:hover span {
color: #5a5a5a;
}
.btnBefore, .btnAfter {
content: '';
position: absolute;
height: 0;
width: 0;
border: solid #000;
border-width: 0;
border-radius: 0;
transition: 0;
-webkit-transition: 0;
-moz-transition: 0;
-o-transition: 0;
-ms-transition: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
border-color: #FF6600;
border-radius: 5px;
}
a .btnBefore {
right: 0;
bottom: 0;
}
a .btnAfter {
left: 0;
top: 0;
}
a:hover .btnBefore {
border-width: 0 0 1px 1px;
}
a:hover .btnAfter {
border-width: 1px 1px 0 0;
}
a:hover .btnAfter, a:hover .btnBefore {
height: 100%;
width: 100%;
transition: width 0.5s ease, height 0.5s ease 0.5s, border-top-right-radius 0.1s ease 0.4s, border-bottom-left-radius 0.1s ease 0.4s, border-bottom-right-radius 0.1s ease 0.9s, border-top-left-radius 0.1s ease 0.9s;
-webkit-transition: width 0.5s ease, height 0.5s ease 0.5s, border-top-right-radius 0.1s ease 0.4s, border-bottom-left-radius 0.1s ease 0.4s, border-bottom-right-radius 0.1s ease 0.9s, border-top-left-radius 0.1s ease 0.9s;
-moz-transition: width 0.5s ease, height 0.5s ease 0.5s, border-top-right-radius 0.1s ease 0.4s, border-bottom-left-radius 0.1s ease 0.4s, border-bottom-right-radius 0.1s ease 0.9s, border-top-left-radius 0.1s ease 0.9s;
-o-transition: width 0.5s ease, height 0.5s ease 0.5s, border-top-right-radius 0.1s ease 0.4s, border-bottom-left-radius 0.1s ease 0.4s, border-bottom-right-radius 0.1s ease 0.9s, border-top-left-radius 0.1s ease 0.9s;
-ms-transition: width 0.5s ease, height 0.5s ease 0.5s, border-top-right-radius 0.1s ease 0.4s, border-bottom-left-radius 0.1s ease 0.4s, border-bottom-right-radius 0.1s ease 0.9s, border-top-left-radius 0.1s ease 0.9s;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.