博客列表 >用户注册页面

用户注册页面

江流
江流原创
2021年09月23日 16:03:55762浏览

  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. <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css" />
  9. <style>
  10. .main {
  11. width: 400px;
  12. margin: 0 auto;
  13. background-color: yellowgreen;
  14. padding: 20px;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <div class="main">
  20. <h2 style="text-align: center">用户注册</h2>
  21. <form action="check.php" method="POST" style="display: grid; gap: 0.5em">
  22. <!-- form 添加onsubmit="return false",提交失效 -->
  23. <fieldset>
  24. <legend>必填项</legend>
  25. <div>
  26. <label for="username"> 账号: </label>
  27. <input
  28. type="text"
  29. id="username"
  30. name="username"
  31. placeholder="输入用户名"
  32. required
  33. autofocus
  34. />
  35. </div>
  36. <div>
  37. <label for="pwd"> 密码: </label>
  38. <input
  39. type="password"
  40. id="pwd"
  41. name="pwd"
  42. placeholder="不少于6个字符"
  43. required
  44. /><button
  45. type="button"
  46. onclick="document.querySelector('#pwd').type='text'"
  47. >
  48. <i class="fa fa-eye" aria-hidden="true"></i>
  49. </button>
  50. </div>
  51. <div>
  52. <label for="emai"> 邮箱: </label
  53. ><input
  54. type="email"
  55. id="email"
  56. name="email"
  57. placeholder=""
  58. required
  59. />
  60. </div>
  61. </fieldset>
  62. <fieldset>
  63. <legend>选填项</legend>
  64. <div>
  65. <label for="phone">电话:</label>
  66. <input type="text" name="phone" id="phone" />
  67. </div>
  68. <div>
  69. <label for="qq">QQ号:</label>
  70. <input type="text" name="qq" id="qq" />
  71. </div>
  72. </fieldset>
  73. <div>
  74. <label for="secret">性别:</label>
  75. <input type="radio" id="male" name="gender" value="male" />
  76. <label for="male"></label>
  77. <input type="radio" id="female" name="gender" value="female" />
  78. <label for="female"></label>
  79. <input
  80. type="radio"
  81. id="secret"
  82. name="gender"
  83. value="secret"
  84. checked
  85. />
  86. <!-- checked布尔属性,存在就是true -->
  87. <label for="secret">保密</label>
  88. </div>
  89. <!-- 复选框 -->
  90. <div>
  91. <label for="">爱好:</label>
  92. <input type="checkbox" id="football" name="hobby" value="football" />
  93. <label for="football">足球</label>
  94. <input
  95. type="checkbox"
  96. id="basketball"
  97. name="hobby"
  98. value="basketball"
  99. />
  100. <label for="basketball">篮球</label>
  101. <input
  102. type="checkbox"
  103. id="vollyball"
  104. name="hobby"
  105. value="vollyball"
  106. />
  107. <!-- checked布尔属性,存在就是true -->
  108. <label for="vollyball">排球</label>
  109. </div>
  110. <div>
  111. 用户身份:
  112. <select name="level" id="">
  113. <option value="1">非会员</option>
  114. <option value="2">普通会员</option>
  115. <option value="3">VIP</option>
  116. </select>
  117. </div>
  118. <!-- datalist +input -->
  119. <!-- 自定义列表 -->
  120. <div>
  121. <label for="">搜索关键字:</label>
  122. <input type="search" name="search" list="keywords" />
  123. <datalist id="keywords">
  124. <option value="java">java</option>
  125. <option value="html">html</option>
  126. <option value="C">C</option>
  127. </datalist>
  128. </div>
  129. <button>提交</button>
  130. <!-- 自定义验证规则 -->
  131. <!-- 重置回复到默认值 -->
  132. <button type="reset">重置</button>
  133. </form>
  134. </div>
  135. </body>
  136. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议