xxxxxxxxxx
1
2
<div class="container">
3
<h1>CSS3 Button <span>Hover</span> Effects</h1>
4
5
<div class="button-effect">
6
<h2>Effect #1</h2>
7
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
8
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
9
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
10
</div>
11
12
<div class="button-effect">
13
<h2>Effect #2</h2>
14
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
15
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
16
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
17
</div>
18
19
<div class="button-effect">
20
<h2>Effect #3</h2>
21
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
22
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
23
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
24
</div>
25
26
<div class="button-effect">
27
<h2>Effect #4</h2>
28
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
29
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
30
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
31
</div>
32
33
<div class="button-effect">
34
<h2>Effect #5</h2>
35
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
36
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
37
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
38
</div>
39
40
</div>
xxxxxxxxxx
1
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css');
2
3
body {
4
background-color: #F1E9DA;
5
}
6
body .container {
7
width: 850px;
8
margin: 70px auto 0px auto;
9
text-align: center;
10
}
11
body .container h1 {
12
font-family: 'Droid Serif', serif;
13
font-weight: 400;
14
font-style: normal;
15
font-size: 30px;
16
margin-bottom: 30px;
17
}
18
body .container h1 span {
19
font-weight: 700;
20
font-style: italic;
21
color: #D90368;
22
border-bottom: 2px dashed currentColor;
23
}
24
body .container .button-effect {
25
padding: 30px 0px;
26
}
27
body .container .button-effect h2 {
28
font-family: 'Droid Serif', serif;
29
font-size: 20px;
30
margin-bottom: 40px;
31
}
32
body .container .button-effect a {
33
margin-right: 17px;
34
}
35
body .container .button-effect a:nth-child(2) {
36
background-color: #541388;
37
}
38
body .container .button-effect a:nth-child(3) {
39
background-color: #D90368;
40
}
41
body .container .button-effect a:nth-child(4) {
42
background-color: #104547;
43
}
44
body .container .button-effect a:last-child {
45
margin-right: 0px;
46
}
47
48
.effect {
49
text-align: center;
50
display: inline-block;
51
position: relative;
52
text-decoration: none;
53
color: #fff;
54
text-transform: capitalize;
55
/* background-color: - add your own background-color */
56
font-family: 'Roboto', sans-serif;
57
/* put your font-family */
58
font-size: 18px;
59
padding: 20px 0px;
60
width: 150px;
61
border-radius: 6px;
62
overflow: hidden;
63
}
64
65
/* effect-1 styles */
66
.effect.effect-1 {
67
-webkit-transition: all 0.2s linear 0s;
68
transition: all 0.2s linear 0s;
69
}
70
.effect.effect-1:before {
71
content: "\f178";
72
font-family: FontAwesome;
73
font-size: 15px;
74
position: absolute;
75
display: -webkit-box;
76
display: -ms-flexbox;
77
display: flex;
78
-webkit-box-align: center;
79
-ms-flex-align: center;
80
align-items: center;
81
-webkit-box-pack: center;
82
-ms-flex-pack: center;
83
justify-content: center;
84
right: 0;
85
top: 0;
86
opacity: 0;
87
height: 100%;
88
width: 40px;
89
-webkit-transition: all 0.2s linear 0s;
90
transition: all 0.2s linear 0s;
91
}
92
.effect.effect-1:hover {
93
text-indent: -20px;
94
}
95
.effect.effect-1:hover:before {
96
opacity: 1;
97
text-indent: 0px;
98
}
99
100
/* effect-2 styles */
101
.effect.effect-2 {
102
-webkit-transition: all 0.2s linear 0s;
103
transition: all 0.2s linear 0s;
104
}
105
.effect.effect-2:before {
106
content: "\f0a4";
107
font-family: FontAwesome;
108
font-size: 15px;
109
display: -webkit-box;
110
display: -ms-flexbox;
111
display: flex;
112
-webkit-box-align: center;
113
-ms-flex-align: center;
114
align-items: center;
115
-webkit-box-pack: center;
116
-ms-flex-pack: center;
117
justify-content: center;
118
position: absolute;
119
top: 0;
120
right: -30px;
121
width: 30px;
122
height: 100%;
123
background-color: rgba(255, 255, 255, 0.3);
124
border-radius: 0px 6px 6px 0px;
125
-webkit-transition: all 0.2s linear 0s;
126
transition: all 0.2s linear 0s;
127
text-align: center;
128
}
129
.effect.effect-2:hover {
130
text-indent: -30px;
131
}
132
.effect.effect-2:hover:before {
133
right: 0;
134
text-indent: 0px;
135
}
136
137
/* effect-3 styles */
138
.effect.effect-3 {
139
-webkit-transition: all 0.2s linear 0s;
140
transition: all 0.2s linear 0s;
141
}
142
.effect.effect-3:before {
143
content: "\f178";
144
font-family: FontAwesome;
145
position: absolute;
146
display: -webkit-box;
147
display: -ms-flexbox;
148
display: flex;
149
-webkit-box-align: center;
150
-ms-flex-align: center;
151
align-items: center;
152
-webkit-box-pack: center;
153
-ms-flex-pack: center;
154
justify-content: center;
155
position: absolute;
156
top: 100%;
157
left: 0px;
158
width: 100%;
159
height: 100%;
160
text-align: center;
161
font-size: 30px;
162
-webkit-transition: all 0.2s linear 0s;
163
transition: all 0.2s linear 0s;
164
}
165
.effect.effect-3:hover {
166
text-indent: -9999px;
167
}
168
.effect.effect-3:hover:before {
169
top: 0;
170
text-indent: 0;
171
}
172
173
/* effect-4 styles */
174
.effect.effect-4 {
175
-webkit-transition: all 0.2s linear 0s;
176
transition: all 0.2s linear 0s;
177
}
178
.effect.effect-4:before {
179
content: "\f178";
180
font-family: FontAwesome;
181
display: -webkit-box;
182
display: -ms-flexbox;
183
display: flex;
184
-webkit-box-align: center;
185
-ms-flex-align: center;
186
align-items: center;
187
-webkit-box-pack: center;
188
-ms-flex-pack: center;
189
justify-content: center;
190
position: absolute;
191
top: 0;
192
left: 0px;
193
width: 100%;
194
height: 100%;
195
text-align: center;
196
font-size: 30px;
197
-webkit-transform: scale(0, 1);
198
transform: scale(0, 1);
199
-webkit-transition: all 0.2s linear 0s;
200
transition: all 0.2s linear 0s;
201
}
202
.effect.effect-4:hover {
203
text-indent: -9999px;
204
}
205
.effect.effect-4:hover:before {
206
-webkit-transform: scale(1, 1);
207
transform: scale(1, 1);
208
text-indent: 0;
209
}
210
211
/* effect-5 styles */
212
.effect.effect-5 {
213
-webkit-transition: all 0.2s linear 0s;
214
transition: all 0.2s linear 0s;
215
}
216
.effect.effect-5:before {
217
content: "\f054";
218
font-family: FontAwesome;
219
display: -webkit-box;
220
display: -ms-flexbox;
221
display: flex;
222
-webkit-box-align: center;
223
-ms-flex-align: center;
224
align-items: center;
225
-webkit-box-pack: center;
226
-ms-flex-pack: center;
227
justify-content: center;
228
position: absolute;
229
top: 0;
230
left: 0px;
231
height: 100%;
232
width: 30px;
233
background-color: rgba(255, 255, 255, 0.3);
234
border-radius: 0 50% 50% 0;
235
-webkit-transform: scale(0, 1);
236
transform: scale(0, 1);
237
-webkit-transform-origin: left center;
238
transform-origin: left center;
239
-webkit-transition: all 0.2s linear 0s;
240
transition: all 0.2s linear 0s;
241
}
242
.effect.effect-5:hover {
243
text-indent: 30px;
244
}
245
.effect.effect-5:hover:before {
246
-webkit-transform: scale(1, 1);
247
transform: scale(1, 1);
248
text-indent: 0;
249
}
1
1
Console errors: 0