实例 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单</title> </head> <body> <form action="" method="post"> <table border="1" style="border-color: white" cellspacing="1" cellpadding="8" align="center" width="450" bgcolor="#cccccc"> <caption><h3>用户注册</h3></caption> <tr > <td align="left" width="20%"><label for="nanme">姓名</label></td> <td align="left" ><input type="text" name="" id="name" value="" placeholder="请输入姓名" size="20"></td> </tr> <tr > <td align="left"><label for="password">密码</label></td> <td align="left" ><input type="text" name="name" id="password" value="" placeholder="不少于6位数字" size="20"></td> </tr> <tr > <td align="left">性别</td> <td align="left"> <input type="radio" name="sex" value="male" checked="">男 <input type="radio" name="sex" value="female">女 <input type="radio" name="sex" value="secret">保密 </td> </tr> <tr > <td align="left"><label for="time">出生年月</label></td> <td align="left"><input type="text" id="time" name="time" value="" size="4">年<input type="text" id="time" name="time" value="" size="2">月<input type="text" id="time" name="time" value="" size="2">日</td> </tr> <tr > <td align="left"><label for="level">所在系</label></td> <td align="left"> <select name="level" id="level"> <option value="">公共管理系</option> <option value="" selected="">传媒与艺术</option> <option value="">经济管理</option> </select> </td> </tr> <tr > <td align="left"><label for="photo">头像上传</label></td> <td align="left"> <img src="images/wwe.jpg" width="60"> <input type="file" id="" name="photo" accept="image/*"> </td> </tr> <tr > <td align="left"><label for="comment">简介</label></td> <td align="left"><textarea name="comment" id="comment" rows="5" cols="40" placeholder="填写个人简介"></textarea></td> </tr> <tr> <td colspan="2">个人爱好</td> </tr> <tr> <td colspan="2" align="center" style="font-size: 18px"> <input type="checkbox" name="happy[]" value="sing" checked="">唱歌 <input type="checkbox" name="happy[]" value="tiao">跳舞 <input type="checkbox" name="happy[]" value="du">读书 <input type="checkbox" name="happy[]" value="you">交友<br> <input type="checkbox" name="happy[]" value="shu">书法 <input type="checkbox" name="happy[]" value="wang">上网 <input type="checkbox" name="happy[]" value="lv">旅游 <input type="checkbox" name="happy[]" value="liao" >聊天 </td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" name="submit" value="提交"> <input type="submit" name="submit" value="重填"> </td> </tr> </table> </form> </body> </html> 运行实例 » 点击 "运行实例" 按钮查看在线实例