博客列表 >html+css用户注册模板

html+css用户注册模板

零龙
零龙原创
2020年06月24日 09:02:271018浏览

html+css用户注册模板


  • 实例

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>用户注册</title>
  7. </head>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. h3 {
  15. text-align: center;
  16. margin-top: 30px;
  17. color: #666;
  18. }
  19. form {
  20. width: 60%;
  21. margin: 10px auto;
  22. border-top: 1px solid #ccc;
  23. }
  24. form > fieldset {
  25. margin: 20px auto;
  26. padding-left: 15px;
  27. color: red;
  28. border-radius: 10px;
  29. box-shadow: 2px 2px 4px #bbb; /*背景阴影 */
  30. }
  31. form > fieldset > legend {
  32. background-color: rgb(212, 219, 255);
  33. border-radius: 10px; /*边框弧度 */
  34. color: rgb(255, 80, 80);
  35. padding: 5px 15px;
  36. }
  37. form > fieldset > div {
  38. margin: 15px;
  39. color: #666;
  40. }
  41. form div {
  42. margin: 5px;
  43. }
  44. form p {
  45. text-align: center;
  46. }
  47. form .btn {
  48. width: 80px;
  49. height: 30px;
  50. border: none;
  51. background-color: seagreen;
  52. color: #ddd;
  53. }
  54. form .btn:hover {
  55. background-color: coral;
  56. color: white;
  57. cursor: pointer;
  58. }
  59. input:text{
  60. height: 30px;
  61. line-height: 20px;
  62. }
  63. input:focus {
  64. background-color: rgb(226, 226, 175);
  65. }
  66. form .rinput{
  67. height: 25px;
  68. width: 200px;
  69. }
  70. </style>
  71. <body>
  72. <h3>用户注册</h3>
  73. <form method="POST" action="#" name="form">
  74. <fieldset>
  75. <legend>基本信息(必填)</legend>
  76. <div>
  77. <label for="username_id">账号:</label>
  78. <input
  79. type="text"
  80. id="username_id"
  81. name="username"
  82. placeholder="6-15位字符"
  83. autofocus
  84. class="rinput"
  85. />
  86. *
  87. </div>
  88. <div>
  89. <label for="pass_id">密码:</label>
  90. <input
  91. type="password"
  92. id="pass_id"
  93. name="pass"
  94. placeholder="不少于6位且字母+数字"
  95. class="rinput"
  96. />
  97. *
  98. </div>
  99. <div>
  100. <label for="pass_id_1">确认:</label>
  101. <input
  102. type="password"
  103. id="pass_id_1"
  104. name="pass_1"
  105. placeholder="不少于6位且字母+数字"
  106. class="rinput"
  107. />
  108. *
  109. </div>
  110. <div>
  111. <label for="email_id">邮件:</label>
  112. <input
  113. type="text"
  114. id="email_id"
  115. name="email"
  116. placeholder="demo@example.com"
  117. class="rinput"
  118. />
  119. *
  120. </div>
  121. </fieldset>
  122. <fieldset>
  123. <legend>扩展信息(选填)</legend>
  124. <div>
  125. <label for="birthday">生日:</label>
  126. <input type="date" name="birthday" />
  127. </div>
  128. <div>
  129. <label for="secret">性别:</label>
  130. <input type="radio" name="sex" value="male" id="male" />
  131. <label for="male"></label>
  132. <input type="radio" name="sex" value="female" id="female" />
  133. <label for="female"></label>
  134. <input type="radio" name="sex" value="secret" id="secret" />
  135. <label for="secret">保密</label>
  136. </div>
  137. <div>
  138. <!-- 复选框 -->
  139. <label for="programme">爱好:</label>
  140. <!-- 因为复选框返回是一个或多个值,最方便后端用数组来处理, 所以将name名称设置为数组形式便于后端脚本处理 -->
  141. <input type="checkbox" name="hobby[]" id="game" value="game" />
  142. <label for="game">打游戏</label>
  143. <input type="checkbox" name="hobby[]" value="shoot" id="shoot" />
  144. <label for="shoot">摄影</label>
  145. <input
  146. type="checkbox"
  147. name="hobby[]"
  148. value="programme"
  149. id="programme"
  150. checked
  151. /><label for="programme">编程</label>
  152. </div>
  153. <div>
  154. <!-- 选项列表 -->
  155. <label for="brand">手机:</label>
  156. <input type="search" list="phone" name="brand" id="brand" class="rinput"/>
  157. <datalist id="phone">
  158. <option value="apple"> </option>
  159. <option value="huawei" label="华为"></option>
  160. <option value="mi" label="小米"> </option>
  161. </datalist>
  162. </div>
  163. </fieldset>
  164. <fieldset>
  165. <legend>其它信息(选填)</legend>
  166. <!--文件上传-->
  167. <div>
  168. <label for="uploads">上传头像:</label>
  169. <input
  170. type="file"
  171. name="user_pic"
  172. id="uploads"
  173. accept="image/png, image/jpeg, image/gif"
  174. />
  175. </div>
  176. <!--文本域-->
  177. <div>
  178. <label for="resume">简历:</label>
  179. <!--注意文本域没有value属性-->
  180. <textarea
  181. name="resume"
  182. id="resume"
  183. cols="30"
  184. rows="5"
  185. placeholder="不超过100字"
  186. ></textarea>
  187. </div>
  188. </fieldset>
  189. <input type="hidden" name="user_id" value="123" />
  190. <p>
  191. <input type="submit" value="提交" class="btn" />
  192. <button class="btn">提交</button>
  193. </p>
  194. </form>
  195. </body>
  196. </html>
  • 实例效果图

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