File tree 3 files changed +65
-1
lines changed
3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+
4
+ < head >
5
+ < meta charset ='utf-8 '>
6
+ < meta http-equiv ='X-UA-Compatible ' content ='IE=edge '>
7
+ < title > HTML Tips and Tricks - Dialog Tag</ title >
8
+ < meta name ='viewport ' content ='width=device-width, initial-scale=1 '>
9
+ < link href ="https://fonts.googleapis.com/css2?family=Chilanka&display=swap " rel ="stylesheet ">
10
+ < link rel ='stylesheet ' type ='text/css ' media ='screen ' href ='../main.css '>
11
+ </ head >
12
+
13
+ < body >
14
+ < div class ="demo ">
15
+ < a href ="../index.html " class ="home ">
16
+ < img src ="../home.svg " alt ="home " />
17
+ </ a >
18
+ < h1 > Dialog Tag</ h1 >
19
+ <!-- Trigger/Open The Modal -->
20
+ < button id ="openDlg "> Open Dialog</ button >
21
+
22
+ < dialog id ="dialog ">
23
+ < form method ="dialog ">
24
+ < h2 > I'm a Dialog</ h2 >
25
+ < p > What do you think of me?</ p >
26
+ < menu >
27
+ < button > Close me</ button >
28
+ </ menu >
29
+ </ form >
30
+ </ dialog >
31
+
32
+ </ div >
33
+ < script >
34
+ // Get the modal
35
+ const dialog = document . getElementById ( "dialog" ) ;
36
+
37
+ const btn = document . getElementById ( "openDlg" ) ;
38
+
39
+ // When the user clicks the button, open the dialog
40
+ btn . onclick = function ( ) {
41
+ dialog . showModal ( ) ;
42
+ }
43
+
44
+
45
+ </ script >
46
+
47
+ </ body >
48
+
49
+ </ html >
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ <h1>HTML5 Feature Tips</h1>
71
71
< a href ='./meter/index.html '>
72
72
Meter and Progress</ a > - Display a gauge
73
73
</ li >
74
+ < li >
75
+ < a href ='./dialog/index.html '>
76
+ Dialog</ a > - Display a Modal Dialog
77
+ </ li >
74
78
</ ul >
75
79
</ div >
76
80
</ body >
Original file line number Diff line number Diff line change 63
63
64
64
.demo .range output {
65
65
font-size : 62px ;
66
- }
66
+ }
67
+
68
+ dialog ::backdrop {
69
+ background : repeating-linear-gradient (
70
+ 45deg ,
71
+ rgba (0 , 0 , 0 , 0.2 ),
72
+ rgba (0 , 0 , 0 , 0.2 ) 1px ,
73
+ rgba (0 , 0 , 0 , 0.3 ) 1px ,
74
+ rgba (0 , 0 , 0 , 0.3 ) 20px
75
+ );
76
+ backdrop-filter : blur (3px );
77
+ }
You can’t perform that action at this time.
0 commit comments