I wrote a registration interface as follows:
The
<form action="registPro" method="post" id="regist"> <div> <input type="text" id="name" name="user.username" placeholder="用户名"> </div> <span id="msg01" class="msg"></span> <div> <input type="password" id="pass" name="user.pass" placeholder="设置密码"> </div> <span id="msg02" class="msg"></span> <div> <input type="submit" id="submit" value="注 册" class="button"/> </div>
<style type="text/css"> input{width:280px;height:30px} .msg{color:red; font-size:1pt;} div{text-align:center;line-height:60px;} .button{background-color:OrangeRed;width:250px;height:30px;border:0;}</style>
.msg{color:red; font-size:1pt; text-align:center; display:block;}
.msg{color:red; font-size:1pt; text-align:center; display:block;}
.msg{color:red; font-size:1pt; text-align:center; display:block;}
.msg{color:red; font-size:1pt;display:block;width:280px;margin:0 auto;}
<div class="cen"><form action="registPro" method="post" id="regist"> <div> <input type="text" id="name" name="user.username" placeholder="用户名"> </div> <span id="msg01" class="msg">ssssss</span> <div> <input type="password" id="pass" name="user.pass" placeholder="设置密码"> </div> <span id="msg02" class="msg">ssss</span> <div class="tc"> <input type="submit" id="submit" value="注 册" class="button"/> </div> </form></div> <style type="text/css"> .tc{text-align:center;} .cen{text-align:center;margin:0 auto;width:300px;} .cen form{text-align:left;} input{width:280px;height:30px} .msg{color:red; font-size:1pt;} div{line-height:30px;} .button{background-color:OrangeRed;width:250px;height:30px;border:0;}</style>
Put the text box and prompt box in a parent div, and set the css style text-aline:left
If you are practicing by yourself, you can do this If you are writing a company project, you can use the validation framework, which is very convenient
Refer to Jquery validate