"Button Effects - Easy CSS"
Bootstrap 4.1.1 Snippet by ttorrez

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<a class="btn btn-primary slide_right" href="#" role="button">Link: Slide Right</a>
<button class="btn btn-primary slide_left" type="submit">Button: Slide Left</button>
</div>
<div class="row">
<a class="btn btn-primary slide_right_alt" href="#" role="button">Link: Slide Right</a>
<button class="btn btn-primary slide_left_alt" type="submit">Button: Slide Left</button>
</div>
<div class="row">
<a class="btn btn-primary slide_top" href="#" role="button">Link: Slide Down</a>
<button class="btn btn-primary slide_bottom" type="submit">Button: Slide Up</button>
</div>
<div class="row">
<a class="btn btn-primary slide_top_alt" href="#" role="button">Link: Slide Down</a>
<button class="btn btn-primary slide_bottom_alt" type="submit">Button: Slide Up</button>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.btn {
margin:.5rem; /* for this demo */
}
/* slide to right */
.slide_right {
border:none;
background-position: right;
background: linear-gradient(to right, #00356f 50%,#007bff 50%) no-repeat scroll right bottom / 210% 100% #007bff;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
transition: all 200ms ease;
}
.slide_right:hover, .slide_right.active {
background-position: left;
color: #ffffff;
}
/* slide to right alt colors */
.slide_right_alt {
border:none;
background-position: right;
background: linear-gradient(to right, #007bff 50%,#00356f 50%) no-repeat scroll right bottom / 210% 100% #007bff;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
transition: all 200ms ease;
}
.slide_right_alt:hover, .slide_right_alt.active {
background-position: left;
color: #ffffff;
}
/* slide to left */
.slide_left {
border:none;
background-position: left;
background: linear-gradient(to left, #00356f 50%,#007bff 50%) no-repeat scroll left bottom / 210% 100% #007bff;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
transition: all 200ms ease;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: