您的位置:首页 > Web前端 > HTML

html框架frame

2013-12-23 09:24 363 查看
示例1:

a.html

[html]
view plaincopy

<html>
<frameset cols = "50%,*">
<frame name = "frame1" src = "b.html" noresize>
<frame name = "frame2" src = "c.html">
</frameset>
</html>

注意:

该网页里面不能有body或body体

b.html

[html]
view plaincopy

<body bgcolor = "pink">
<!--target表示点击后,目标指向谁-->
<a href = "zjl.html" target = "frame2">周杰伦</a><br/>
<a href = "qq.html" target = "frame2">齐秦</a><br/>
</body>

target属性有四个

_blank:新窗口

_self:本窗口

_parent:父窗口

_top: 整个浏览器窗口

或在target值中直接写框架中name对应的名字

c.html

[html]
view plaincopy

<body bgcolor = "silver">
c.html
</body>

zjl.html

[html]
view plaincopy

<body>
周杰伦的歌
</body>

qi.html

[html]
view plaincopy

<body>
齐秦的歌
</body>



示例2:

结构图



all.html

[html]
view plaincopy

<frameset rows = "30%,*">
<frame src = "top.html" />
<frameset cols = "20%,*">
<frame src = "left.html" noresize frameborder = "0">
<frame src = "right.html" name = "myframe" frameborder = "0">
</frameset>
</frameset>

top.html

[html]
view plaincopy

<img src = "title.jpg" width = "1351px" />

left.html

[html]
view plaincopy

<body bgcolor = "pink">
<ul>
<li><a href = "zjl.html" target = "myframe">周杰伦</a></li>
<li><a href = "qq.html" target = "myframe">齐秦</a></li>
</ul>
</body>

right.html

[html]
view plaincopy

<body bgcolor = "silver">
歌词大全
</body>



转自:http://blog.csdn.net/wfdtxz/article/details/8272694
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: