-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-drop.html
41 lines (40 loc) · 1001 Bytes
/
01-drop.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Drop down</title>
<style>
body {
margin: 2rem;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}
h1 {
font-size: 1.5rem;
}
.container {
margin: 0 auto;
max-width: 500px;
}
.drop {
width: 280px;
border: 1px solid #ddd;
background-color: #f5f5f5;
border-radius: 1rem;
padding: 1.5rem;
}
</style>
</head>
<body>
<div class="container" x-data="{ opened: false }">
<h1>Drop down Apline.js</h1>
<p>
<button @click="opened = true">Abrir</button>
</p>
<div class="drop" x-show="opened" @click.outside="opened = false">
Soy el drop down
</div>
</div>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
</body>
</html>