1、引入广告或是网页,直接将地址填写在src中即可
<div>
<span>嵌入网页:</span>
<br>
<iframe src="https://search.jd.com/search" frameborder="0" width="600" height="500"></iframe>
</div>
2、与超链接配合使用
超链接a标签中设置指向地址,并将打开目标target设置为iframe的name即可
<a href="https://search.jd.com/search" target="tt">点我去京东</a>
<iframe name="tt" frameborder="1" width="600" height="500"></iframe>
3、与form表单配合使用
操作基本同上,但可以发送数据
<form action="https://search.jd.com/search" target="pp" id="search">
<input type="text" name="keyword" placeholder="京东搜索">
<input type="submit" value="确认">
</form>
<br>
<iframe name="pp" width="600" height="500"></iframe>