How to place an iframe over an image?

2019-07-05 05:14发布

问题:

I'd like to place an image under my iframe, but i've pieced together some code and it doesn't appear to be exactly right. The iframe contains text and has a transparent background. Can you help me out? thanks,

<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>

回答1:

<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>

You have 'display:none' on the div tag that contains the iframe. I tested the above code and it works as you have explained is should.



标签: html iframe