<form> <label>员工号:</label> <input type="text" name="wid" class="wid" /><span class="wierror"></span><br/> <label>用户名:</label> <input type="text" name="wname" class="wname" /><span class="wnerror"></span><br/> <label>密码:</label> <input type="password" name="wpassword" class="wpassword" /><span class="wperror"></span><br/> <input type="submit" id="submit" value="登陆"/> </form>
三行css使表单对齐
label { display:inline-block; width: 65px; text-align: right; }
结果
原文:http://www.cnblogs.com/niuni-623/p/6765475.html