如何让多个输入框对齐
2016-07-15 20:16
387 查看
我们在制作用户的登录或者是注册表单时,经常会遇到输入框对不齐的情况,这样表单整体看起来就特别的丑,最简单的方法最笨的方法就是加空格,然而这种方法最好在迫不得已的是后才使用。接下来就给大家提供一个表单中的输入框对齐的模版。
以下只给出用户登录的html代码,验证码的代码不再说明。
以下只给出用户登录的html代码,验证码的代码不再说明。
<!DOCTYPE html> <html> <head> <meta charset="GBK"> <title>用户登录</title> <style> form{padding:0px 15px 15px 120px;} form{width:500px;height:300px;} form fieldset{border:0;align:center;} form label{display:inline-block;width:60px;text-align:right} input{width:240px;height:30px;} #submit{width:200px;height:35px;position:relative;left:70px;} #submit:hover{ cursor: pointer; background:#D8D8D8; } body{ width:100%; height:100%; background: #E9E9E9; } #box{position:fixed;left:0px;right:0px;width:706px;margin-left:auto;margin-right:auto;top:100px;} #code{width: 70px; height: 40px; font-size:18px;} #captcha_img{ position:relative; bottom:-15px; } a{position:relative;bottom:-10px;} </style> </head> <body> <div id="box"> <form method="post"action="login.php"style="background:#cccccc"> <fieldset> <p> <label>用户名:</label> <input type="text"name="username"placeholder="用户名"required="required"/> </p> <p> <label>密码:</label> <input type="password"name="password"placeholder="密码"required="required"/> </p> <p> <label>验证码:</label> <input type="text"name="authcode"value=""required="required" id="code"/> <img id="captcha_img"src="idcode.php"/> <a href="javascript:void(0)"onclick="document.getElementById('captcha_img').src='idcode.php'">看不清</a><!-- javascript:void(0)是一个死链接不会跳转也不会返回到顶部. --> </p> <p> <a href="register.html">没注册</a> </p> <p> <input type="submit"value="登陆"name="submit" id="submit"/> </p> </fieldset> </form> </div> </body> </html>
相关文章推荐
- 【AD】取消普通域用户帐号加域权限&授权特定普通域用户加域权限
- android service 学习
- UVA-10815 Andy's First Dictionary
- Android小知识点积累
- unity中的碰撞检测
- eetcode_c++:链表:Swap Nodes in Pairs(024)
- CentOS6.5的用户管理
- VS2013 TeeChart控件使用方法
- cdoj 1334 郭大侠与Rabi-Ribi 贪心+数据结构
- 校外分散实习(8)
- ef第一次启动较慢
- 在windows系统上安装VMware Workstation虚拟机,然后在虚拟机VMware Workstation上安装linux系统,在linux系统安装xshell的服务端,在windows系统上安装xshell。用windows系统上的xshell连接到linux
- 字典树+博弈 CF 455B A Lot of Games(接龙游戏)
- STL"源码"剖析-重点知识总结
- Ubuntu root用户登录设置
- 浅谈C的scanf
- 【前端开发】CSS布局
- HDU1937How many ways(记忆化搜索)入门
- Codeforces 23 E Tree 树形dp+高精
- 高级数据管理