test.html
766 Bytes
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
<!DOCTYPE html>
<html>
<head>
<style>
#ref {
background: orange;
width: 50px;
height: 50px;
}
#pop {
background: green;
width: 50px;
height: 50px;
}
.container {
align-items: center;
background: blue;
border: 20px solid red;
display: flex;
height: 400px;
justify-content: center;
margin: auto;
position: relative;
width: 400px;
}
</style>
</head>
<body>
<div class="container">
<div id="ref" aria-describedby="pop">ref</div>
<div id="pop" role="tooltip">pop</div>
</div>
<script src="../../dist/umd/popper.js"></script>
<script>
const refEl = document.getElementById("ref");
const popEl = document.getElementById("pop");
const popper = new Popper(refEl, popEl);
</script>
</body>
</html>