<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<div style="background-image: url('images1.jpg');width:800;height:300;border:1px solid black">
<iframe scrolling="auto" allowtransparency="true" name="main" style="width:100%;height:90%;"> </iframe>
</div>
</BODY>
</HTML>
我需要将背景图片添加到 iframe。所以我试图将背景图片添加到 iframe 但我不能..所以我使用上面的 div 标签来完成它。 它在 firefox 中正常工作,但在 IE 中不正常。如果你知道这个请帮助我
最佳答案
你可以在 css 中使用 background-image
iframe{
background:url(http://www.hindsightfishing.com/images/waves_bg.jpg) no-repeat left top
}
关于javascript - iframe 的背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12457107/