当前位置: 首页 > 网络学院 > 网页制作基础教程 > WEB设计综合 > IFrames 简介
iframe 案例
IFrames are different from regular frames, because unlike regular frames, IFrames can be positioned anywhere on the page, and can be any size. Example: Now copy this code, and paste it somewhere on your page.
与传统的框架是不同,IFrame 可以任意尺寸在页面的任何一处定位。举个例子来说:你可以复制下面的代码,然后将它粘贴到网页的任意地方:
<div style="position: absolute; top:300; left:400"> <IFRAME src="PAGEURL.htm" name="frame" width="200" height="200" frameborder="0"></iframe></div> |
Edit all of the numbers. The width and height determine how big your IFrame will be. The top and left numbers determine where the IFrame will be placed on your site. The larger the number for the top position is, the further down it will go. The larger the left number is, the further right it will go. Keep altering these numbers until you are happy with them. You also must change PAGEURL.htm to the url of your IFrame. To make a link target your IFrame (have the link come up in the IFrame) copy the code below, but change PAGEURL.htm to your preferred URL.
编辑上面代码中的属性值,width和height定义了IFrame的大小。Top和 left定义了IFrame位于页面中的具体方位。Top值越大,它就位于页面中最越靠下面的地方;Left值越大,它就位于页面中最越靠右面的地方。你可以根据你的要求随意地更改这些数字,直到你满意为止。同时,你必须将PAGEURL.htm添加到IFrame的URL中。将下面的代码复制到IFrame(这个IFrame已经包含具体的链接)中来创建一个目标链接,将这里的PAGEURL.htm改为你所设定的具体页面链接。
<a href="PAGEURL.htm" target="frame"> |