3.表单.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>表单</title>
  6. </head>
  7. <body>
  8. <!--
  9. 规范:万维网联盟组织规定
  10. 表单:
  11. form
  12. action:把表单中的内容提交给别的表单(很少会用)
  13. 1.input 输入框 placeholder 提示信息 行内块元素
  14. 属性: 1.type
  15. a.text 文本
  16. b.password 密码
  17. c.button 按钮
  18. d.reset 重置按钮
  19. e.submit 提交按钮
  20. f.radio 单选框
  21. 注:实现单选框加相同的name属性名称
  22. h.checkbox 多选框
  23. checked默认选择 disabled禁止选中
  24. 2.value 内容/值
  25. 2.label 信息标签 配合着input标签使用
  26. -->
  27. <form action="">
  28. <label>分类</label>
  29. <input type="text" placeholder="提示信息">
  30. <br>
  31. <label>密码</label>
  32. <input type="password" placeholder="提示信息">
  33. <input type="button" value="123">
  34. <input type="reset">
  35. <input type="submit">
  36. <input type="radio" name="11">男
  37. <input type="radio" name="11">女
  38. <input type="checkbox" checked>桃子
  39. <input type="checkbox" disabled>苹果
  40. <input type="checkbox">梨
  41. <input type="checkbox">橙子
  42. <!-- 下拉框
  43. 由select 搭配 option一起构成
  44. disabled 禁止选中
  45. selected 默认选中
  46. -->
  47. <select>
  48. <option value="桃子">桃子</option>
  49. <option value="苹果" selected>苹果</option>
  50. <option value="梨" disabled>梨</option>
  51. <option value="橙子">橙子</option>
  52. </select>
  53. <!--
  54. 文本域 textarea
  55. cols 列
  56. rows 行
  57. maxlength 最大长度
  58. -->
  59. <textarea cols="10" rows="20" placeholder="请输入" maxlength="10"></textarea>
  60. </form>
  61. </body>
  62. </html>