3.表单.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 单选框 注:实现单选框加相同的name属性名称
  21. h.checkbox 多选框
  22. checked默认选择 disabled禁止选中
  23. 2.value 内容/值
  24. 2.label 信息标签 配合着input标签使用
  25. -->
  26. <form action="">
  27. <label>分类</label>
  28. <input type="text" placeholder="提示信息">
  29. <br>
  30. <label>密码</label>
  31. <input type="password" placeholder="提示信息">
  32. <input type="button" value="123">
  33. <input type="reset">
  34. <input type="submit">
  35. <input type="radio" name="11">男
  36. <input type="radio" name="11">女
  37. <input type="checkbox" checked>桃子
  38. <input type="checkbox" disabled>苹果
  39. <input type="checkbox">梨
  40. <input type="checkbox">橙子
  41. <!-- 下拉框
  42. 由select 搭配 option一起构成
  43. disabled 禁止选中
  44. selected 默认选中
  45. -->
  46. <select>
  47. <option value="桃子">桃子</option>
  48. <option value="苹果" selected>苹果</option>
  49. <option value="梨" disabled>梨</option>
  50. <option value="橙子">橙子</option>
  51. </select>
  52. <!--
  53. 文本域 textarea
  54. cols 列
  55. rows 行
  56. maxlength 最大长度
  57. -->
  58. <textarea cols="10" rows="20" placeholder="请输入" maxlength="10"></textarea>
  59. </form>
  60. </body>
  61. </html>