Skip to content

Commit c3353a8

Browse files
Add simple demo
1 parent 8062d0b commit c3353a8

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

index.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8"/>
5+
<title>Float Label</title>
6+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"/>
7+
<link rel="stylesheet" href="dist/float-label.css"/>
8+
<style>
9+
body {
10+
position: relative;
11+
max-width: 20rem;
12+
background: #eee;
13+
margin: 2rem auto;
14+
}
15+
fieldset {
16+
padding: 1.5rem;
17+
background: white;
18+
}
19+
input {
20+
margin-bottom: .5rem;
21+
}
22+
button {
23+
background: #333;
24+
color: white;
25+
border: 0;
26+
padding: .5em 1em;
27+
margin-top: 1rem;
28+
}
29+
a {
30+
position: absolute;
31+
z-index: -1;
32+
width: 100px;
33+
top: 3.3rem;
34+
left: -21px;
35+
transition: all .2s;
36+
}
37+
a:hover {
38+
left: -62px;
39+
z-index: 0;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<fieldset>
45+
<legend>Sign up</legend>
46+
47+
<div class="has-float-label">
48+
<input type="text" placeholder="First Last"/>
49+
<label>Name</label>
50+
</div>
51+
52+
<div class="has-float-label">
53+
<input type="email" placeholder="[email protected]"/>
54+
<label>Email</label>
55+
</div>
56+
57+
<div class="has-float-label">
58+
<input type="password" placeholder="••••••••"/>
59+
<label>Password</label>
60+
</div>
61+
62+
<div class="has-float-label">
63+
<select>
64+
<option>United States</option>
65+
<option>Canada</option>
66+
</select>
67+
<label>Country</label>
68+
</div>
69+
70+
<button>Sign up</button>
71+
</fieldset>
72+
73+
<!---->
74+
<a href="https://github.com/tonystar/float-label-css" target="_blank">
75+
<img src="https://img.shields.io/github/stars/tonystar/float-label-css.svg?style=social&label=Star"/>
76+
</a>
77+
</body>
78+
</html>

0 commit comments

Comments
 (0)