如何让一个iframe 背景透明?

来源:互联网 发布:人工智能 公司 top100 编辑:程序博客网 时间:2024/06/09 18:11
网上查到让一个iframe 背景透明的办法:
首先在<body style="background-color:transparent"></body>
然后:
<iframe src="你的地址" allowtransparency="true" style="background-color:transparent" title="test" frameborder="0" width="470" height="308" scrolling="no"></iframe>

问题在于这里src里的文件不再我本机上,,我没办法设置它的<body style="background-color:transparent"></body>如下,我要引用天气预报:
<iframe src="http://weather.265.com/weather.htm" width="168" height="54" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>

我的底色是蓝的,可这个底色是白的http://weather.265.com/weather.htm
这样该怎么办?

那就不要用iframe实现,你先把这个页面得到它的内部,然后再显示在页面里,
可以用ajax得到这个页面

不过这样是不是跨域了!
0 0
原创粉丝点击