网上查到让一个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得到这个页面
使 iframe 在插入的面背景透明
最新推荐文章于 2025-12-04 23:20:36 发布
本文介绍了当iframe源文件不在本地且无法直接修改其背景颜色时的一种解决方案——使用AJAX获取页面内容并显示,避免了iframe背景色与整体页面不协调的问题。
884

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



