h1 Link Hover Effects
h2: a.effect-1(href="") Link Hover Effect 1
h2: a.effect-2(href="") Link Hover Effect 2
h2: a.effect-3(href="") Link Hover Effect 3
h2: a.effect-4(href="") Link Hover Effect 4
h2: a.effect-5(href=""): span Link Hover Effect 5
h2: a.effect-6(href=""): span Link Hover Effect 6
h2: a.effect-7(href="", data-content="Link Hover Effect 7"): span Link Hover Effect 7
h2: a.effect-8(href="", data-content="Link Hover Effect 8"): span Link Hover Effect 8
View Compiled
$bg: #0BAAD4;
$text: rgba(255,255,255,.7);
$hover: darken($bg, 10%);
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
*, *:before, *:after {
box-sizing: border-box;
}
body {
width: 80%;
margin: 50px auto;
color: $text;
font: 16px/1 'Open Sans', sans-serif;
background: $bg;
&:after {
content: '';
display: table;
clear: both;
}
}
h1 {
margin: 0 0 50px;
font-weight: normal;
color: #fff;
transition: all .3s ease;
&:hover {
text-shadow: 1px 1px 0 lighten($bg, 15%), 2px 2px 0 lighten($bg, 10%), 3px 3px 0 lighten($bg, 5%);
transform: translate(-3px,-3px);
}
}
h2 {
float: left;
width: 50%;
height: 44px;
margin: 30px 0;
line-height: 24px;
text-align: center;
font-weight: normal;
@media screen and (max-width: 768px) {
width: 100%;
}
}
a, a > span {
position: relative;
color: inherit;
text-decoration: none;
line-height: 24px;
&:before, &:after {
content: '';
position: absolute;
transition: transform .5s ease;
}
}
//------- {{ effect-1 }} -------//
.effect-1 {
padding-top: 10px;
&:before {
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background: $hover;
transform: scaleX(0);
}
&:hover:before {
transform: scaleX(1);
}
}
//------- {{ effect-2 }} -------//
.effect-2 {
padding: 10px;
&:before, &:after {
left: 0;
top: 0;
width: 100%;
height: 100%;
border-style: solid;
border-color: $hover;
}
&:before {
border-width: 2px 0 2px 0;
transform: scaleX(0);
}
&:after {
border-width: 0 2px 0 2px;
transform: scaleY(0);
}
&:hover:before, &:hover:after {
transform: scale(1, 1);
}
}
//------- {{ effect-3 }} -------//
.effect-3 {
display: inline-block;
padding-top: 10px;
padding-bottom: 5px;
overflow: hidden;
&:before {
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background: $hover;
transform: translateX(-100%);
}
&:hover:before {
transform: translateX(0);
}
}
//------- {{ effect-4 }} -------//
.effect-4 {
padding: 10px;
display: inline-block;
overflow: hidden;
&:before, &:after {
left: 0;
width: 100%;
height: 2px;
background: $hover;
}
&:before {
bottom: 0;
transform: translateX(-100%);
}
&:after {
top: 0;
transform: translateX(100%);
}
&:hover:before, &:hover:after {
transform: translateX(0);
}
}
//------- {{ effect-5 }} -------//
.effect-5 {
display: inline-block;
overflow: hidden;
&:before, &:after {
right: 0;
bottom: 0;
background: $hover;
}
&:before {
width: 100%;
height: 2px;
transform: translateX(-100%);
}
&:after {
width: 2px;
height: 100%;
transform: translateY(100%);
}
> span {
display: block;
padding: 10px;
&:before, &:after {
left: 0;
top: 0;
background: $hover;
}
&:before {
width: 100%;
height: 2px;
transform: translateX(100%);
}
&:after {
width: 2px;
height: 100%;
transform: translateY(-100%);
}
}
&:hover:before, &:hover:after, &:hover > span:before, &:hover > span:after {
transform: translate(0, 0);
}
}
//------- {{ effect-6 }} -------//
.effect-6 {
display: inline-block;
overflow: hidden;
&:before, &:after {
right: 0;
bottom: 0;
background: $hover;
transition: transform .3s ease;
}
&:before {
width: 100%;
height: 2px;
transform: translateX(-100%);
transition-delay: .9s;
}
&:after {
width: 2px;
height: 100%;
transform: translateY(100%);
transition-delay: .6s;
}
> span {
display: block;
padding: 10px;
&:before, &:after {
left: 0;
top: 0;
background: $hover;
transition: transform .3s ease;
}
&:before {
width: 100%;
height: 2px;
transform: translateX(100%);
transition-delay: .3s;
}
&:after {
width: 2px;
height: 100%;
transform: translateY(-100%);
transition-delay: 0s;
}
}
&:hover:before, &:hover:after, &:hover > span:before, &:hover > span:after {
transform: translate(0, 0);
}
&:hover:before {
transition-delay: 0s;
}
&:hover:after {
transition-delay: .3s;
}
&:hover > span:before {
transition-delay: .6s;
}
&:hover > span:after {
transition-delay: .9s;
}
}
//------- {{ effect-7 }} -------//
.effect-7 {
display: inline-block;
overflow: hidden;
&:before {
left: 0;
top: 0;
width: 100%;
height: 100%;
background: $hover;
transform: translateX(-100%);
}
&:after {
content: attr(data-content);
left: 0;
top: 0;
width: 0;
margin: 12px;
color: $hover;
white-space: nowrap;
overflow: hidden;
transition: width .5s ease;
}
> span {
display: block;
margin: 2px;
padding: 10px;
background: $bg;
}
&:hover:before {
transform: translateX(0);
}
&:hover:after {
width: calc(100% - 24px);
}
}
//------- {{ effect-8 }} -------//
.effect-8 {
display: inline-block;
overflow: hidden;
&:before {
left: 0;
top: 0;
width: 100%;
height: 100%;
background: $hover;
transform: translateY(-100%);
}
&:after {
content: attr(data-content);
top: 0;
left: 0;
height: 0;
margin: 12px;
color: $hover;
white-space: nowrap;
overflow: hidden;
transition: height .5s ease;
}
> span {
display: block;
margin: 2px;
padding: 10px;
background: $bg;
}
&:hover:before {
transform: translateY(0);
}
&:hover:after {
height: calc(100% - 24px);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.