开发者

iframe background image

开发者 https://www.devze.com 2022-12-11 07:47 出处:网络
I have a iframe on my page. I have inserted a background image on it. but its not showing the Image. Here is my code.

I have a iframe on my page. I have inserted a background image on it. but its not showing the Image. Here is my code.

 <iframe scrolling="auto" allowtransparency="true" name="m开发者_开发问答ain" style="width:100%;height:90%" style="background-image:url(img/bg2.jpg)"> </iframe>


Try this:

<iframe scrolling="auto" allowtransparency="true" name="main" style="width:100%;height:90%;background-image:url(img/bg2.jpg)"> </iframe>

if it doesn't work move the background images to the container of the iframe.


Wrap your iframe with div and put it some class. Ex:

<div class="wrap">
<iframe style="display:none" width="325" height="276" frameborder="0" scrolling="auto"></iframe>
</div>

in css: .wrap{background:url(somepicture);} .wrap iframe{opacity:0;}


Try this .. it should work(tested in IE/Firefox/Google Crome)

<div><img src="a.JPG"></div>

<div>
<iframe style="display:none" width="325" height="276" frameborder="0" scrolling="auto"></iframe>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消