-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopupmenu.html
More file actions
88 lines (75 loc) · 1.91 KB
/
Copy pathpopupmenu.html
File metadata and controls
88 lines (75 loc) · 1.91 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<head>
<title>Click the button for a pop-up menu</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
#popup {
display: none;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
border: 2px solid black;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
padding: 20px;
z-index: 1;
}
#popup table {
width: 100%;
border-collapse: collapse;
}
#popup td {
padding: 15px;
text-align: center;
border-bottom: 1px solid #ddd;
}
#popup button {
padding: 10px 15px;
color: white;
border: none;
}
#popup button:hover {
background-color: darkred;
}
button#openPopup {
padding: 10px 20px;
}
</style>
</head>
<body>
<button id="openPopup" onclick="showPopup()">OpenMe</button>
<div id="popup">
<table>
<tr>
<td>ABC</td>
</tr>
<tr>
<td>PQR</td>
</tr>
<tr>
<td>XYZ</td>
</tr>
<tr>
<td><button onclick="hidePopup()">Close me</button></td>
</tr>
</table>
</div>
<script>
function showPopup() {
document.getElementById("popup").style.display = "block";
}
function hidePopup() {
document.getElementById("popup").style.display = "none";
}
</script>
</body>
</html>