博客列表 >HTML里的form表单

HTML里的form表单

布道者PHP学习笔记
布道者PHP学习笔记原创
2022年10月19日 15:10:19421浏览
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>用户注册</title>
  8. </head>
  9. <body>
  10. <form action="register.php" id="register" method="post">
  11. <div class="username">
  12. <label for="username">用户名:</label>
  13. <input type="text" id="username" name="username" placeholder="请输入用户名" required>
  14. </div>
  15. <div class="pwd">
  16. <label for="pwd">密码:</label>
  17. <input type="password" name="pwd" id="pwd" placeholder="请输入密码" required>
  18. </div>
  19. <div class="blog">
  20. <label for="blog">blog:</label>
  21. <input type="url" name="blog" id="blog">
  22. </div>
  23. <div class="color">
  24. <label for="color">颜色选择器:</label>
  25. <input type="color" name="color" id="color">
  26. </div>
  27. <div class="age">
  28. <label for="age">年龄</label>
  29. <input type="number" name="age" id="age" min="18" max="100">
  30. </div>
  31. <div class="gender">
  32. <label for="secret">性别:</label>
  33. <input type="radio" name="male" id="male">
  34. <input type="radio" name="woman" id="woman">
  35. <input type="radio" name="secret" id="secret" checked>秘密
  36. </div>
  37. <div class="hobby">
  38. <label>爱好:</label>
  39. <input type="checkbox" name="hobby[]" value="game" id="game" checked><label for="game">游戏</label>
  40. <input type="checkbox" name="hobby[]" value="trave" id="trave"><label for="trave">旅游</label>
  41. <input type="checkbox" name="hobby[]" value="shoot" id="shoot"><label for="shoot">摄影</label>
  42. <input type="checkbox" name="hobby[]" value="program" id="program" checked><label for="program">编程</label>
  43. </div>
  44. <div class="birthday">
  45. <label for="birthday">生日</label>
  46. <input type="date" name="birthday" id="birthday" min="1949-10-01" max="2022-10-01">
  47. </div>
  48. <div class="email">
  49. <label for="email">邮箱:</label> <input type="email" name="email" id="email">
  50. </div>
  51. <div class="range">
  52. <label for="star">星级</label>
  53. <input type="range" name="star" id="star" min="1" max="5">
  54. </div>
  55. <div class="education">
  56. <label for="">学历:</label>
  57. <select name="education">
  58. <option value="" selected disabled>--请选择--</option>
  59. <option value="1">小学</option>
  60. <option value="2">初中</option>
  61. <option value="3">高中</option>
  62. <option value="4">专科</option>
  63. <option value="5">本科</option>
  64. </select>
  65. </div>
  66. <div class="file">
  67. <label for="file">上传:</label>
  68. <input type="file">
  69. </div>
  70. <div>
  71. <label for="info">个人简介:</label> <textarea name="info" id="info" cols="30" rows="10"></textarea>
  72. </div>
  73. <button>注册</button> <button type="button">普通</button>
  74. </form>
  75. </body>
  76. </html>

效果展示:

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议