目录
格式:
src:引用页面地址
name:框架标识名
<iframe src="path" name="mainFrame">iframe>
代码测试:
- html>
- <html lang="en" xmlns:th="http://www.thymeleaf.org">
- <head>
- <meta charset="UTF-8">
- <title>内联框架iframetitle>
- head>
- <body>
- <iframe src="//player.bilibili.com/player.html?aid=678141914&bvid=BV1fm4y1D7i6&cid=485620915&page=1"
- scrolling="no"
- border="0"
- frameborder="no"
- framespacing="0"
- allowfullscreen="true"> iframe>
-
- <iframe src="https://www.bilibili.com/" frameborder="0" width="500px" height="500px">iframe>
-
- <iframe src="" name="hello" frameborder="0" width="500px" height="500px">iframe>
-
- <a href="我的第一个网页.html" target="hello">点击跳转a>
- body>
- html>
iframe标签与a标签的配合使用相当于a标签的target属性设为_self
1)表单语法

form 的属性说明:
2)测试get
- html>
- <html lang="en" xmlns:th="http://www.thymeleaf.org">
- <head>
- <meta charset="UTF-8">
- <title>登录注册title>
- head>
- <body>
- <h1>注册h1>
- <form action="我的第一个网页.html" method="get">
- <p>名字:<input type="text" name="username">p>
- <p>密码:<input type="password" name="pwd">p>
- <input type="submit">
- <input type="reset">
- form>
- body>
- html>
运行结果:

网页地址部分会附带提交的参数信息

3)与post 的对比:只需将上述代码的提交方式由get改为post即可
如何获得post提交的元素:
在浏览器中按 F12 打开开发者工具,选择 Network,页面点击提交后会生成箭头所指的一条记录,点击该记录,在FormData处可看见提交信息


4)总结
get 和 post 的区别:
1)表单元素格式

代码测试:只需在上述2中代码中添加几个元素即可
- <p>名字:<input type="text" name="username" value="biubiu" maxlength="8" size="30">p>
2)测试单选框
- <p>性别:<input type="radio" value="boy" name="sex">男
- <input type="radio" value="girl" name="sex">女
- p>

1)测试多选框
- <p>爱好:
- <input type="checkbox" value="sleep" name="hobby">睡觉
- <input type="checkbox" value="code" name="hobby">写代码
- <input type="checkbox" value="chat" name="hobby">聊天
- <input type="checkbox" value="music" name="hobby">听音乐
- p>

2)测试按钮
- <p>按钮:
- <input type="button" name="btn1" value="click it">
- <input type="image" src="../resource/image/1.PNG">
- p>

1)测试下拉框
- <p>下拉框:
- <select name="国家" >
- <option value="SuZhou" selected>苏州option>
- <option value="ShangHai">上海option>
- <option value="BeiJing">北京option>
- <option value="NanJing">南京option>
- select>
- p>
2)测试文本域
- <p>反馈:
- <textarea name="textarea"cols="30" rows="8">文本内容textarea>
- p>
3)测试文件域
- <p>
- <input type="file" name="files">
- <input type="button" value="上传" name="upload">
- p>
1)测试邮箱验证
-
- <p>邮箱:
- <input type="email" name="email">
- p>

2)url验证
- <p>url:
- <input type="url" name="url">
- p>

3)数字验证
- <p>数字:
- <input type="number" name="num" max="100" min="0" step="10">
- p>

4)测试滑块
- <p>滑块:
- <input type="range" name="voice" min="0" max="100" step="2">
- p>
5)测试搜索框
- <p>搜索:
- <input type="search">
- p>