当前位置: 首页 > 网络学院 > 网页制作基础教程 > WEB设计综合 > 透明 IFrames
If you don't already have a basic knowledge of IFrames, click here. OK, let's get started! To make the backgrounds on your IFrames transparent, copy the code below.
如果你对IFrames的基本概念还不了解,那么请点击这里。OK,接下来就让我们开始吧!你将学会如何使得IFrame的背景透明。复制下面的代码到页面中:
<div style="position: absolute; top:300; left:400"> <IFRAME src="PAGEURL.htm" name="frame" width="200" height="200" frameborder="0" allowtransparency="true"></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. Now copy the code below, and paste it into the <head> tag of the page you are linking to (in other words the page that you replaced PAGEURL.htm with).
编辑上面代码中的属性值,width和height定义了IFrame的大小。Top和 left定义了IFrame位于页面中的具体方位。Top值越大,它就位于页面中最越靠下面的地方;Left值越大,它就位于页面中最越靠右面的地方。你可以根据你的要求随意地更改这些数字,直到你满意为止。同时,你必须将PAGEURL.htm添加到IFrame的URL中。接下来,复制下面的这段代码,将它粘贴到链接页的<head>标签中(换句话说,就是粘贴到你替换PAGEURL.htm链接的页面上):
<style> <!-- BODY { background-color: transparent; } --> </style> |
透明iframe案例