4.表单标签.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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>Document</title>
  7. <style>
  8. /* input {
  9. width: 300px;
  10. height: 200px;
  11. } */
  12. </style>
  13. </head>
  14. <body>
  15. <!--
  16. form 表单标签
  17. 属性:action 提交内容到后台
  18. 输入框:
  19. input
  20. 属性:placeholder提示信息
  21. type 类型
  22. 1.text 文本类型
  23. 2.password 密码
  24. 3.submit 提交按钮
  25. 4.reset 重置按钮
  26. 5.button 自定义按钮 配合value属性使用
  27. 6.radio 单选格式 需要设置相同的name属性值
  28. 7.checkbox 多选格式 checked默认选择 禁止选择
  29. -->
  30. <form action="">
  31. <input type="text" placeholder="请输入您的手机号" />
  32. <input type="password" />
  33. <input type="submit" />
  34. <input type="reset" />
  35. <input type="button" value="哈哈哈" />
  36. <br /><br />
  37. <input type="radio" name="aaa" />男
  38. <input type="radio" name="aaa" />女
  39. <br /><br />
  40. <input type="checkbox" />篮球
  41. <input type="checkbox" disabled />足球
  42. <input type="checkbox" checked />羽毛球
  43. <input type="checkbox" />网球
  44. <input type="checkbox" />排球
  45. <!--
  46. button 按钮标签
  47. -->
  48. <button>登录</button>
  49. <!--
  50. 下拉框
  51. select 与 option 搭配使用
  52. option中value的值是绑定数据进行联调
  53. disabled 禁止选择
  54. selected 默认选中
  55. -->
  56. <select>
  57. <option value="1">小学</option>
  58. <option value="2">初中</option>
  59. <option value="3">高中</option>
  60. </select>
  61. <!-- 文本域
  62. textarea
  63. rows 行
  64. cols 列
  65. maxlength 最大输入长度
  66. -->
  67. <textarea rows="20" cols="30" maxlength="10"></textarea>
  68. </form>
  69. </body>
  70. </html>