Skip to content

Commit 69e88cc

Browse files
Update demo
1 parent c5448cf commit 69e88cc

File tree

1 file changed

+45
-15
lines changed

1 file changed

+45
-15
lines changed

index.html

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"/>
77
<link rel="stylesheet" href="dist/float-label.css"/>
88
<style>
9+
* {
10+
box-sizing: border-box;
11+
}
912
body {
1013
position: relative;
1114
max-width: 20rem;
@@ -16,7 +19,8 @@
1619
padding: 1.5rem;
1720
background: white;
1821
}
19-
input {
22+
input, select {
23+
width: 100%;
2024
margin-bottom: .5rem;
2125
}
2226
button {
@@ -27,44 +31,70 @@
2731
margin-top: 1rem;
2832
}
2933
a {
34+
display: block;
35+
padding: 10px;
3036
position: absolute;
3137
z-index: -1;
32-
width: 100px;
33-
top: 3.3rem;
34-
left: -21px;
38+
top: 1rem;
39+
left: 100%;
40+
margin-left: -65px;
3541
transition: all .2s;
3642
}
3743
a:hover {
38-
left: -62px;
39-
z-index: 0;
44+
margin-left: 0;
45+
}
46+
.input-group {
47+
display: table;
48+
width: 100%;
49+
}
50+
.input-group > * {
51+
display: table-cell;
52+
width: 50%;
4053
}
4154
</style>
4255
</head>
4356
<body>
4457
<fieldset>
4558
<legend>Sign up</legend>
4659

60+
<div class="input-group">
4761
<div class="has-float-label">
48-
<input type="text" placeholder="First Last"/>
49-
<label>Name</label>
62+
<input id="first" type="text" placeholder="Name"/>
63+
<label for="first">First</label>
5064
</div>
5165

5266
<div class="has-float-label">
53-
<input type="email" placeholder="[email protected]"/>
54-
<label>Email</label>
67+
<input id="last" type="text" placeholder="Surname"/>
68+
<label for="last">Last</label>
69+
</div>
5570
</div>
5671

57-
<div class="has-float-label">
72+
<label class="has-float-label">
73+
<input type="email" placeholder="[email protected]"/>
74+
<span>Email</span>
75+
</label>
76+
77+
<label class="has-float-label">
5878
<input type="password" placeholder="••••••••"/>
59-
<label>Password</label>
60-
</div>
79+
<span>Password</span>
80+
</label>
6181

62-
<div class="has-float-label">
82+
<div class="input-group">
83+
<label class="has-float-label">
6384
<select>
6485
<option>United States</option>
6586
<option>Canada</option>
6687
</select>
67-
<label>Country</label>
88+
<span>Country</span>
89+
</label>
90+
91+
<div class="has-float-label">
92+
<select id="state">
93+
<option>New York</option>
94+
<option>Texas</option>
95+
</select>
96+
<label for="state">State</label>
97+
</div>
6898
</div>
6999

70100
<button>Sign up</button>

0 commit comments

Comments
 (0)