-
Notifications
You must be signed in to change notification settings - Fork 0
/
7-example.html
77 lines (64 loc) · 2.23 KB
/
7-example.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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Popover API - Tooltip - HelloCoding.de</title>
</head>
<body>
<h1>
Die Popover API ein Tooltip Beispiel
<button popovertarget="popover-element">Info</button>
</h1>
<div id="popover-element" popover>
<p>Ein kleiner Tooltip</p>
</div>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, <a href="">sed</a> diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<style>
body {
max-width: 1220px;
margin: 0 auto;
font-family: sans-serif;
padding: 16px;
line-height: 1.5;
}
h1 {
display: flex;
align-items: center;
line-height: 1;
}
button[popovertarget="popover-element"] {
anchor-name: --popover-anchor;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
padding: 8px 16px;
cursor: pointer;
margin-left: 16px;
}
#popover-element:popover-open {
position: absolute;
position-anchor: --popover-anchor;
top: calc(anchor(bottom) + 16px);
left: anchor(left);
margin: 0;
padding: 16px;
line-height: 1;
font-family: sans-serif;
border: none;
border-radius: 8px;
box-shadow: 0 2px 4px 2px rgb(0 0 0 / 30%);
}
#popover-element:popover-open p {
position: relative;
margin: 0;
}
</style>
</body>
</html>