-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
105 lines (96 loc) · 3.13 KB
/
index.html
File metadata and controls
105 lines (96 loc) · 3.13 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="./tailwind.css" />
<title>Tailwind float label</title>
</head>
<body class="bg-gray-100 flex justify-center p-4">
<div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md">
<h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
<form class="space-y-4">
<div class="float-container">
<label for="fullname" class="float-label px-2 text-gray-600"
>Full Name</label
>
<input
type="text"
id="fullname"
class="float-input w-full px-3 py-2 border border-gray-300"
placeholder="Full Name placeholder"
/>
</div>
<div class="float-container float-always">
<label for="sticky" class="float-label px-2 text-gray-600"
>Sticky (sticky)</label
>
<input
type="text"
id="sticky"
class="float-input w-full px-3 py-2 border border-gray-300"
placeholder="Sticky ph"
/>
</div>
<div class="float-container">
<label for="email" class="float-label px-2 text-gray-600"
>Email Address (2: is focused)</label
>
<input
type="email"
id="email"
class="float-input w-full px-3 py-2 border border-gray-300"
placeholder="Email Address ph"
value="[email protected]"
/>
</div>
<div class="float-container">
<label class="float-label px-2 text-gray-600"
>What type of event is it?</label
>
<select class="float-input w-full px-3 py-2 border border-gray-300">
<option></option>
<option>Corporate event</option>
<option>Wedding</option>
<option>Birthday</option>
<option>Other</option>
</select>
</div>
<div class="float-container">
<label class="float-label px-2 text-gray-600"
>Additional details</label
>
<textarea
class="float-input w-full border border-gray-300 p-2"
rows="3"
placeholder="Additional details"
></textarea>
</div>
<div class="float-container text-3xl">
<label for="bigname" class="float-label px-2 text-gray-600"
>Big Name</label
>
<input
type="text"
id="bigname"
class="float-input w-full px-3 py-2 border border-gray-300"
placeholder="Full Name placeholder"
/>
</div>
<button
type="button"
class="w-full bg-blue-500 text-white py-2 px-4 hover:cursor-pointer"
>
Submit
</button>
</form>
</div>
</body>
</html>
<script>
window.onload = () => {
const focusedElement = document.querySelector('#name');
focusedElement.focus();
};
</script>