-
Notifications
You must be signed in to change notification settings - Fork 0
/
01.simple-html-dialog.html
84 lines (66 loc) · 1.46 KB
/
01.simple-html-dialog.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
83
84
<!DOCTYPE html>
<html>
<head>
<title>html5 dialog example: alternative to modal</title>
<style>
.html5dialog-container {
position: fixed;
bottom: 150px;
left: 0;
width: 80%;
max-width: 600px;
padding: 15px;
box-sizing: border-box;
z-index: 9999;
}
.html5dialog {
background-color: #c6ced6;
color: #0000008a;
border: none;
width: 80%;
border-radius: 5px;
box-shadow: -9px -11px 16px 3px rgb(190 195 217 / 41%);
}
.html5dialog h2 {
color: #343a40;
margin-top: 0;
}
.html5dialog p {
color: #6c757d;
}
.html5dialog:hover {
background-color: #dce6f0;
color: #d4e9ff;
}
.html5dialog button {
background-color: #383c41;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.html5dialog button:hover {
background-color: #0056b3;
}
.html5dialog-button {
margin-left: 10px;
}
</style>
</head>
<body>
<div class="html5dialog-container">
<dialog class="html5dialog" id="html5dialog" open>
<h2>Alternative to Modal</h2>
<p>Our message will show here</p>
<button onclick="dialogButton()">Button</button>
</dialog>
</div>
<script>
function dialogButton() {
document.getElementById('html5dialog').close();
}
</script>
</body>
</html>