JSFiddle - React, Tailwind, and code Playground
Clean Login Form
by Jennifer Perrin
HTML
<div id="login">
<form action="javascript:void(0);" method="get">
<fieldset class="clearfix">
<p><span class="fontawesome-user"></span>
<input type="text" value="Username" onBlur="if(this.value == '') this.value = 'Username'" onFocus="if(this.value == 'Username') this.value = ''" />
</p>
<p><span class="fontawesome-lock"></span>
<input type="password" value="Password" onBlur="if(this.value == '') this.value = 'Password'" onFocus="if(this.value == 'Password') this.value = ''" />
</p>
<p>
<input type="submit" value="Sign In" />
</p>
</fieldset>
</form>
<p>Forgot Password? <a href="#">Reset It</a><span class="fontawesome-arrow-right"></span>
</p>
</div>
CSS
@charset"utf-8";
/* CSS Document */
@import url(http://weloveiconfonts.com/api/?family=fontawesome);
[class*="fontawesome-"]:before {
font-family:'FontAwesome', sans-serif;
}
/* ---------- GENERAL ---------- */
body {
background-color: #2c3338;
color: #606468;
font-family:'Open Sans', Arial, sans-serif;
font-size: 14px;
line-height: 1.5em;
}
a {
color: #eee;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
input {
border: none;
font-family:'Open Sans', Arial, sans-serif;
font-size: 14px;
line-height: 1.5em;
padding: 0;
-webkit-appearance: none;
}
p {
line-height: 1.5em;
}
.clearfix {
*zoom: 1;
}
/* For IE 6/7 */
.clearfix:before, .clearfix:after {
display: table;
content:"";
}
.clearfix:after {
clear: both;
}
/* ---------- LOGIN ---------- */
#login {
margin: 100px auto;
width: 280px;
}
#login fieldset {
border: 0;
}
#login form span {
background-color: #363b41;
border-radius: 3px 0px 0px 3px;
-moz-border-radius: 3px 0px 0px 3px;
-webkit-border-radius: 3px 0px 0px 3px;
color: #606468;
display: block;
float: left;
height: 50px;
line-height: 50px;
text-align: center;
width: 50px;
}
#login form input {
height: 50px;
}
#login form input[type="text"], input[type="password"] {
background-color: #3b4148;
border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
-webkit-border-radius: 0px 3px 3px 0px;
color: #606468;
padding: 0 16px;
width: 198px;
}
#login form input[type="submit"] {
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ea4c88;
color: #eee;
font-weight: bold;
text-transform: uppercase;
width: 280px;
}
#login form input[type="submit"]:hover {
background-color: #d44179;
}
#login > p {
text-align: center;
}
#login > p span {
padding-left: 5px;
}