html基础
## HTML
- 每个标签都有自己独特的能力 输入框
- 标签中通过属性也可以获取某种能力
- input 输入框
- h2 标题
- div 分块,换行
- a 链接
- img 图片
- checkbox radio 多选、单选
- id
- name
- form 表单格式
- table(表格)
- ul
- iframe 子网页
如何传参给后端
<form action="http://httpbin.org/post" method="post"> <div> 性别:<input type="radio" name="gender" value="man">男 <input type="radio" name="gender" value="girl">女 <input type="radio" name="gender" value="unknown">未知 <input type="radio" name="aaa">男女 div> form>
第一行发起post请求,div里相当于{"gender":"man", "gender":"girl", "gender":"unknown",},从name属性中获取键名,value中获取值。
示例html:
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>py44title>
head>
<body>
<h2>登录h2>
<form action="http://httpbin.org/post" method="post">
<div>用户名:<input name="username">div>
<div>密码:<input type="password" name="pass">div>
<div>
性别:<input type="radio" name="gender" value="man">男
<input type="radio" name="gender" value="girl">女
<input type="radio" name="gender" value="unknown">未知
<input type="radio" name="aaa">男女
div>
<div>
喜欢的电影:<input type="checkbox" name="movie" value="zhanlang">战狼
<input type="checkbox" name="movie" value="honghai">红海行动
<input type="checkbox" name="movie" value="shuofu">说服
div>
<div><input type="file" name="avatar">div>
<div><input type="submit">div>
form>
<iframe src="http://www.testingpai.com" width="800px" height="600px">iframe>
body>
html>