先看代码
#formpanel{width:341px;height:135px;margin-left:auto;margin-right:auto;}#username_field{margin-top:0px;width:340px;}#usernamepic{float:left;margin-top:0px;margin-left:0px;}#inputfield{float:right;margin-top:0px;margin-right:0px;width:228px;height:27px;}#password_field{width:340px;}
现在出现的问题是我想出现这样的结果
但是却出现了这样的结果
我在password中设置margin-top却不管用,这是为什么?我想在两个input中间空出24个像素。
回复讨论(解决方案)
#password_field{
margin-top:10px;
width:340px;
}
最快的方法就是:
#password_field{
float:right;
width:340px;
margin-top:24px;
}
希望对你有帮助,欢迎回访!!
用户名同密码一样的布局为什么还要两个不同层,增加无谓的样式,
用户名:
密码:
简单东西不要复杂化,html上面的足矣。
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理