没有前端基础有点难记
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表格布局用户注册表单</title> </head> <body> <form action="" method="post"> <table border="0" cellspacing="0" cellpadding="8" align="center" width="600" bgcolor="#a9a9a9"> <caption><h3>同性恋交友网注册</h3></caption> <tr> <td colspan="2"> </td> </tr> <tr align="center"> <!--lable:点击控件的时候使焦点落在文本框中--> <td align="right"><label for="email">邮箱:</label></td> <td align="left"><input type="text" name="email" id="email" placeholder="example@php.cn" size="30"></td> </tr> <tr align="center"> <td align="right"><label for="password">密码:</label></td> <td align="left"><input type="password" name="password" id="password" placeholder="数字+字母不少于8位" size="30"></td> <tr align="center"> <td align="right"><label for="confirm_password">确认密码:</label></td> <td align="left"><input type="password" name="confirm_password" id="confirm_password" placeholder="数字+字母不少于8位" size="30"></td> <tr> <td align="right">婚姻状况:</td> <td align="left"> <input type="radio" name="marry" value="marrid">已婚 <input type="radio" name="marry" value="unmarrid"marry <input type="radio" name="marry" value="secret" checked>保密 </td> </tr> <tr align="center"> <td align="right">性别:</td> <td align="left"> <input type="radio" name="sex" value="male">男 <input type="radio" name="sex" value="female">女 <input type="radio" name="sex" value="secret" checked>保密 </td> </tr> <tr align="center"> <td align="right">兴趣:</td> <td align="left"> <!--复选框的name必须是数组--> <input type="checkbox" name="hobby[]" value="domestic_violence">打人 <input type="checkbox" name="hobby[]" value="game" checked="">打游戏 <input type="checkbox" name="hobby[]" value="cook">做饭 <input type="checkbox" name="hobby[]" value="wash">洗衣服 </td> </tr> <tr align="center"> <td align="right">想法:</td> <td align="left"> <select name="level"> <option value="1">你抗揍不</option> <option value="2">老婆说的都是对的</option> <option value="3" selected="">浪里个浪</option> <option value="">你就是作</option> </select> </td> </tr> <tr align="center"> <td align="right"><label for="photo">头像:</label></td> <td align="left"> <img src="images/13.png" height="20"> <input type="file" name="photo" id="photo" accept="image/*"> </td> </tr> <tr align="center"> <td align="right"><label for="conment">简介:</label></td> <td align="left"><textarea type="textarea" name="conment" id="conment" placeholder="爱介绍不介绍,随便你" rows="6" cols="40"></textarea></td> </tr> <tr align="center"> <td colspan="2"> <input type="reset" name="reset" value="重新来"> <input type="submit" name="submit" value="提交"> </td> </tr> </table> </form> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例