yandyand

导航

html的内嵌框架

内嵌框架

简介

使用iframe可以在一个页面中引用另一个页面,实现复用,灵活

基本用法:


<iframe src=""></iframe>

常用属性:

. src: 用来指定要引用的页面(必须的)

. width/height 宽度/高度,像素或百分比

. frameborder 是否显示边框 ; 取值 : 1(yes), 0(no)

. scrolling 是否显示滚动条 ; 取值 : yes no auto(当足够显示的时候,不滚动,不够显示了滚动)

. name 为框架定义名称/使用

在框架中打开链接

<a href="链接地址"target="_">链接文本或图像</a>

如果我想让我打开的页面在一个区域中显示


<a href="特殊表单元素.html"target="hello">01.html</a>
<br>
<a href="其他表单元素.html"target="hello">02.html</a>
<br>
<iframe     src="foot.html"width="600px"height="500px"style="background:#cccccc"name="hello"></iframe>
#:在iframe标签中设置name属性
#:然后再超链接标签<a>中设置target的属性等于iframe的名字即可

 

posted on 2020-09-21 23:15  yandyand  阅读(479)  评论(0编辑  收藏  举报