关注前端开发
关注用户体验

iframe背景透明设置方法

iframe的背景颜色在IE下为window的当前窗口颜色(默认白色,可以在显示外观处对其进行设置),这导致在大幅背景上插入iframe时,需要给它“透底”,可是IE不支持对iframe设置背景色,那怎么办呢?

解决办法是在iframe中设置:

allowtransparency=”true”

如下:

<iframe width="100%" height="200" src="demo.html" allowTransparency="true" frameBorder="0" scrolling="no"></iframe>
赞(3)
未经允许不得转载:大前端 » iframe背景透明设置方法
分享到: 更多 (0)

评论 27

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #24

    J’ai la possibilité de vous en transférer les sites pour d’autres d’échantillons à propos de cet idée. Joignez moi ici!

  2. #23

    I know this web site gives quality dependent posts and additional
    data, is there any other web page which provides these kinds of stuff in quality?

  3. #22

    Thanks for the help!

  4. #21

    heavy window curtains would be much needed this december to conserve more heat**

  5. #20

    As I website possessor I think the content material here is really superb , appreciate it for your efforts.

    wiecej pomocy2周前 (05-15)回复
  6. #19

    Hello there, just became aware of your blog through Google, and found that it’s truly informative. I am going to watch out for brussels. I will be grateful if you continue this in future. Lots of people will be benefited from your writing. Cheers!

    Nonton Anime2周前 (05-10)回复
  7. #18

    Hey there! Wonderful stuff, please do tell us when you post again something similar!

    cat3周前 (05-09)回复
  8. #17

    I was very happy to find this web site. I wanted to thank you for ones time just for this fantastic read!! I definitely loved every part of it and I have you book-marked to look at new things on your site.

    DMC52个月前 (04-07)回复
  9. #16

    Your style is very unique compared to other people I have read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I’ll just book mark this site.

    Apex Legends DPS2个月前 (03-31)回复
  10. #15

    Hi there! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone. I’m trying to find a template or plugin that might be able to resolve this issue. If you have any suggestions, please share. Thanks!

    my singing monsters2个月前 (03-28)回复
  11. #14

    I view something really special in this internet site .

    Letha Diegidio3个月前 (03-11)回复
  12. #13

    如果无法更改iframe引用的页面,如何设置背景色透明呢

    %appdata%4年前 (2015-08-13)回复
  13. #12

    还需要在iframe上设置内联样式:style background-color:transparent;

    Mr.Snail5年前 (2014-05-13)回复
  14. #11

    iframe用处很广泛,html5肯定还会支持啊

    胎盘素8年前 (2011-12-26)回复
  15. #10

    改了没效果啊

    wade.wind8年前 (2011-12-21)回复
  16. #9

    为什么d3我不能用

    博客爪8年前 (2011-11-23)回复
  17. #8

    为啥用了没效果?
    这是代码

    swr123588年前 (2011-08-18)回复
  18. #7

    期待更多作者和优秀作品的加入

    coach wallet outlet8年前 (2011-04-09)回复
  19. #6

    嗯,这个以前老是在找!

    Way8年前 (2011-04-08)回复
  20. #5

    又学到了~~~ 😀

    heson8年前 (2011-04-07)回复
  21. #4

    貌似最近的更新速度有点小慢了。。。。不过还是支持了!

    qixun8年前 (2011-04-06)回复
    • 最近有点晕,抱歉,加强更新!!

      浩子8年前 (2011-04-07)回复
  22. #3

    大前段很不错的,有很多前端开发的知识,支持一个!!! 🙂

    锋翼8年前 (2011-04-06)回复
  23. #2

    一直在等待,等待属于自己的一篇领地,与其等待,不如奋起创造····

    错别字一个~~一篇领地

    这个站是浩子一个人在维护吗?

    xiaoc8年前 (2011-04-06)回复
    • 估计是,好像所有的文章都是署名浩子

      蜜瓜8年前 (2011-04-06)回复
    • 嗯,马上改过。目前大前端有3个作者,期待更多作者和优秀作品的加入!!

      浩子8年前 (2011-04-06)回复
  24. #1

    很久不用iframe了,没想到html5还支持着 😡

    hear8年前 (2011-04-06)回复

themebetter 国内更好的WordPress主题服务商

立即前往