HTML:
<div id="form">
<form id="login" class="loginform" action="">
<p>
<label for="username">Username:</label>
<input type="text" id="username" value="" />
</p>
<p>
<label for="password">Password:</label>
<input type="text" id="password" value="" />
</p>
<p>
<label for="forgot">Forgot Password?</label>
<input type="checkbox" id="forgot"/>
</p>
<p>
<input type="submit" value="Submit" />
</p>
</form>
</div>
CSS:#form {
vertical-align: center;
width: 400px;
margin: 80px auto;
border: 1px solid #5BA380;
background: #ffffff;
padding: 10px;
}
.loginform p{
width: 300px;
clear: left;
margin: 0;
padding: 5px 0 8px 0;
padding-left: 155px; /*width of left column containing the label elements*/
}
.loginform label{
font-weight: bold;
float: left;
margin-left: -155px; /*width of left column*/
width: 150px; /*width of labels. Should be smaller than left column (155px) to create some right margin*/
}
.loginform input[type="text"]{ /*width of text boxes. IE6 does not understand this attribute*/
width: 180px;
}
.loginform textarea{
width: 250px;
height: 150px;
}
/*.threepxfix class below:
Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
*/
* html .threepxfix{
margin-left: 3px;
}
No comments:
Post a Comment
Please feel free to leave a comment