-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfloating btn.html
More file actions
67 lines (59 loc) · 1.67 KB
/
floating btn.html
File metadata and controls
67 lines (59 loc) · 1.67 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Floating Plus Button</title>
<!-- <link rel="stylesheet" href="style.css"> -->
<style type="text/css">
body {
font-family: Arial, sans-serif;
}
.floating-btn {
position: fixed;
bottom: 20px; /* Distance from the bottom of the screen */
right: 20px; /* Distance from the right of the screen */
width: 60px;
height: 60px;
background-color: #28a745; /* Green background */
color: white;
font-size: 30px;
border: none;
border-radius: 50%; /* Circular shape */
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: background-color 0.3s;
}
/* Hover effect */
.floating-btn:hover {
background-color: #218838; /* Darker green on hover */
}
/* Responsive styling for mobile and smaller screens */
@media (max-width: 768px) {
.floating-btn {
width: 50px; /* Smaller button for tablets */
height: 50px;
font-size: 25px; /* Smaller icon for tablets */
bottom: 15px; /* Adjust position */
right: 15px;
}
}
@media (max-width: 480px) {
.floating-btn {
width: 40px; /* Even smaller button for mobile */
height: 40px;
font-size: 20px; /* Smaller icon for mobile */
bottom: 10px; /* Adjust position further */
right: 10px;
}
}
</style>
</head>
<body>
<!-- Floating Plus Button -->
<button class="floating-btn" onclick="location.href='#'">+</button>
</body>
</html>