【问题标题】:iFrame marin-bottom not workingiFrame marin-bottom 不工作
【发布时间】:2015-02-01 00:55:48
【问题描述】:

我在 IFrame 上使用负边距设置来仅显示源的特定部分。

我有这样的代码来切断 Iframe 源的顶部、左侧和底部部分。虽然源代码的顶部和左侧部分被很好地修剪,但“margin-bottom”设置不会切断源页面的底部部分。

关于这里出了什么问题的任何线索以及修复它的建议?谢谢

<div dir="ltr" style="width: 100%; height: 800px; overflow: hidden; display: block;">

<p dir="ltr">
   <iframe height="800" scrolling="yes" src="http://localhost/testPage.html" 
     style="overflow: hidden; margin-top: -180px; margin-bottom: -180px; margin-left: -260px;" 
     width="100%">
    </iframe>
 </p>
</div>

【问题讨论】:

  • 请分享代码。

标签: iframe margin


【解决方案1】:

<div dir="ltr" style="width: 100%; height: 800px; overflow: hidden; display: block;">

<p dir="ltr">
   <iframe height="800" scrolling="yes" src="http://localhost/testPage.html" 
     style="overflow: hidden; margin-top: -180px; margin-bottom: -180px; margin-left: -260px;" 
     width="100%">
    </iframe>
 </p>
</div>

【讨论】:

  • 对不起。我没有遵循这里的解决方案。
猜你喜欢
  • 1970-01-01
  • 2019-02-24
  • 2017-12-15
  • 2016-04-02
  • 2014-04-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多