2.iframe
frame在frameset中比较死板,iframe在div中可以在绝对的任何位置。
例 2.2.1(example1.html)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<div style="position:absolute;top: 20px; left:20px;">
<iframe src="iframe2.html" id="tag" name="tag"
width="250" height="100" scrolling="yes" frameborder="1">
</iframe>
</div>
这有一行文本
<div style="position:absolute;top: 20px; left:300px;">
<iframe src="iframe3.html" id="test3"
width="450" height="300" scrolling="no" frameborder="1">
</iframe>
</div>
<div style="position:absolute;top: 300px; left:200px;">
<iframe src="iframe4.html" id="test3"
width="450" height="300" scrolling="no" frameborder="0">
</iframe>
</div>
</body>
</htm
iframe2.html
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body style="BACKGROUND-COLOR:red;">
<table width="50" height="20">
<tr>
<td>1</td>
本文详细介绍了如何在HTML页面中使用iframe元素,并展示了通过绝对定位将iframe放置在任意位置的方法。通过实例,读者可以了解如何设置iframe的src、width、height等属性,以及如何在页面上同时展示多个iframe。
1503

被折叠的 条评论
为什么被折叠?



