内嵌框架的关键字:
iframe
iframe 可也与body共存
格式:
<iframe name="content" src=""></iframe> |
name:自定义的框架名称;未来可以使用在超链接的target属性取值中; Src:路径
下面是代码
1.iframe.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<img src="img/tu.PNG" width="100%"/>
<a href="list.html"></a>
<iframe style="width: 100%; height: 400px; border: 0;"
name="content" src="list.html"></iframe>
</body>
</html>
2.list.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul{
list-style: none;
}
</style>
</head>
<body>
<ul><li><img src="img/ren.PNG"></li></ul>
<ul><li><a href="zhu.html" target="content"><img src="img/zhuce.PNG"></a></li></ul>
<ul><li><a href="maijia.html"target="content"><img src="img/mai.PNG"></a></li></ul>
<ul><li><a href="poaeple.html"target="content"><img src="img/geren.PNG"></a></li></ul>
</body>
</html>