forked from androidcss/css3-floating-button
-
Notifications
You must be signed in to change notification settings - Fork 0
/
css3-floating-button-with-label.html
82 lines (72 loc) · 1.42 KB
/
css3-floating-button-with-label.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>floating button demo</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style type="text/css">
*{padding:0;margin:0;}
body{
font-family:Verdana, Geneva, sans-serif;
background-color:#CCC;
font-size:12px;
}
.label-container{
position:fixed;
bottom:48px;
right:105px;
display:table;
visibility: hidden;
}
.label-text{
color:#FFF;
background:rgba(51,51,51,0.5);
display:table-cell;
vertical-align:middle;
padding:10px;
border-radius:3px;
}
.label-arrow{
display:table-cell;
vertical-align:middle;
color:#333;
opacity:0.5;
}
.float{
position:fixed;
width:60px;
height:60px;
bottom:40px;
right:40px;
background-color:#06C;
color:#FFF;
border-radius:50px;
text-align:center;
box-shadow: 2px 2px 3px #999;
}
.my-float{
font-size:24px;
margin-top:18px;
}
a.float + div.label-container {
visibility: hidden;
opacity: 0;
transition: visibility 0s, opacity 0.5s ease;
}
a.float:hover + div.label-container{
visibility: visible;
opacity: 1;
}
</style>
</head>
<body>
<a href="#" class="float">
<i class="fa fa-envelope my-float"></i>
</a>
<div class="label-container">
<div class="label-text">Feedback</div>
<i class="fa fa-play label-arrow"></i>
</div>
</body>
</html>