Html 如何在图像上放置iframe?
我想在iframe下放置一个图像,但我拼凑了一些代码,它似乎并不完全正确。iframe包含文本并具有透明背景。你能帮我吗?谢谢Html 如何在图像上放置iframe?,html,iframe,Html,Iframe,我想在iframe下放置一个图像,但我拼凑了一些代码,它似乎并不完全正确。iframe包含文本并具有透明背景。你能帮我吗?谢谢 <td width="216" style="position: relative;"> <img src="http://southwestarkansasradio.com/images/onair995.jpg"></a><br> <img src="http://southwestarkansasradio.
<td width="216" style="position: relative;">
<img src="http://southwestarkansasradio.com/images/onair995.jpg"></a><br>
<img src="http://southwestarkansasradio.com/images/playerbackground.jpg" style="z-index: -1"/>
<div style="absolute;left:0px;top:0px;font-size: 32px;display: none">
<iframe name="I1" width="316" height="216" src="http://southwestarkansasradio.com /NowPlaying.html" border="0" frameborder="0" allowTransparency="true">
Your browser does not support inline frames.</iframe>
</div>
</td>
您的浏览器不支持内嵌框架。
您的浏览器不支持内嵌框架。
在包含iframe的div标记上有“display:none”。我测试了上面的代码,正如您所解释的,它可以正常工作。使用单独的CSS文件移动所有对象。从长远来看,这会容易得多。如果你想将iframe向下移动一点以适应图像,而不是横幅,只需添加
边距顶部:40px
或图片要向下移动iframe的像素数。将其添加到包含iframe的div标记上的style属性中。谢谢,我认为问题还在于缺少“position:”…现在将其对齐。
<img src="http://southwestarkansasradio.com/images/onair995.jpg"></a><br>
<img src="http://southwestarkansasradio.com/images/playerbackground.jpg" style="z-index: -1"/>
<div style="position:absolute;left:0px;top:0px;font-size: 32px">
<iframe width="316" height="216" src="http://southwestarkansasradio.com/NowPlaying.html" border="0" frameborder="0" allowTransparency="true">
Your browser does not support inline frames.</iframe>
</div>