表格对齐输入
我在对齐密码输入框使其与电子邮件地址输入框对齐时遇到问题,有什么想法吗?
**CSS:**
.column-right-login{
background:url('../image/login.png') no-repeat;
width:335px;
height:154px;
padding: 30px 0px 0px 10px; /* top right bottom left */
}
.column-right-login input{
margin-left:15px;
}
.column-right-login a{
color:#fff;
}
HTML:
<div class="column-right-login">
<form action="http://www.thetradinghouse.co.nz/login" method="post" enctype="multipart/form-data" id="homeLogin">
<div><label for="email">Email Address: </label> <input type="text" name="email" value="" /></div>
<div><label for="password">Password: </label> <input type="password" name="password" value="" /></div>
<a href="http://www.thetradinghouse.co.nz/forgot-password">Forgotten Password</a>
<a onclick="$('#homeLogin').submit();" class="button"><span>Login</span></a>
</form>
<script type="text/javascript"><!--
$('#homeLogin input').keydown(function(e) {
if (e.keyCode == 13) {
$('#homeLogin').submit();
}
});
//--></script>
</div>
I am having an issue with aligning my password input box so its aligned with the email address input box any ideas?
**CSS:**
.column-right-login{
background:url('../image/login.png') no-repeat;
width:335px;
height:154px;
padding: 30px 0px 0px 10px; /* top right bottom left */
}
.column-right-login input{
margin-left:15px;
}
.column-right-login a{
color:#fff;
}
HTML:
<div class="column-right-login">
<form action="http://www.thetradinghouse.co.nz/login" method="post" enctype="multipart/form-data" id="homeLogin">
<div><label for="email">Email Address: </label> <input type="text" name="email" value="" /></div>
<div><label for="password">Password: </label> <input type="password" name="password" value="" /></div>
<a href="http://www.thetradinghouse.co.nz/forgot-password">Forgotten Password</a>
<a onclick="$('#homeLogin').submit();" class="button"><span>Login</span></a>
</form>
<script type="text/javascript"><!--
$('#homeLogin input').keydown(function(e) {
if (e.keyCode == 13) {
$('#homeLogin').submit();
}
});
//--></script>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这只是一个想法:
示例:http://jsfiddle.net/aTuFq/2/
资源: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
This is just one idea:
sample: http://jsfiddle.net/aTuFq/2/
Resources: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
这可行,但我建议您阅读这篇文章:
http://www.alistapart.com/articles/prettyaccessibleforms
This works, but I suggest you go read this article:
http://www.alistapart.com/articles/prettyaccessibleforms