html基础

## HTML
- 每个标签都有自己独特的能力 <input> 输入框 <h2>
- 标签中通过属性也可以获取某种能力

- 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>py44</title>
</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>

<!--    <a href="http://www.baidu.com">-->
<!--        <img src="resume.png" width="400px" height="300px">-->
<!--    </a>-->

    <iframe src="http://www.testingpai.com" width="800px" height="600px"></iframe>


</body>
</html>
原文地址:https://www.cnblogs.com/wsfsd/p/15585335.html