【问题标题】:How to get rid of this whitespace in internet explorer?如何摆脱 Internet Explorer 中的这个空白?
【发布时间】:2023-04-02 05:50:02
【问题描述】:

我在 Internet Explorer 7/8 中有一个类似 Facebook 的按钮让我很烦(这在 Firefox、Google Chrome 或 IE9(+) 中不会发生)

我想摆脱白色区域,但如何?相关的 HTML 和 CSS 是

<div class="fbstuff">  
    <div style="margin-top:3px;margin-left:15px;float:right;">         
        <iframe src="http://www.facebook.com/plugins/like.phphref=http://www.bnano.eu&amp;layout=button_count&amp;locale=en_US" scrolling="no" frameborder="0" style="border:none; width:200px; height:80px"></iframe>
    </div>
</div>

我不知道为什么会出现白色区域,而且这似乎只发生在 =Here's 实时链接。谢谢。

【问题讨论】:

  • 填充:0;边距:0; ?
  • 你似乎使用宽度来设置右边距?为什么不使用 margin-right 和跳过宽度/高度?

标签: html css graphics components


【解决方案1】:

您在此处设置 iframe 的 html 中的宽度和高度:

width:200px; height:80px

如果您删除这些值,您的浏览器将呈现 iframe 的默认大小。而是将这些值设置为精确到按钮的尺寸。

您在 IE 中看到它而不是在 firefox 中看到它的原因是,firefox 将 iframe 背景呈现为透明,而旧 IE 将其呈现为白色

【讨论】:

    【解决方案2】:

    您将宽度和高度设置为 200x80:

    width:200px; height:80px
    

    删除此代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-14
      • 1970-01-01
      • 2014-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-21
      相关资源
      最近更新 更多