【问题标题】:hide specific area form bottom of iframe从 iframe 底部隐藏特定区域
【发布时间】:2017-06-30 19:30:09
【问题描述】:

我在 iframe 中嵌入了网站以在 webview 应用程序中使用

<body>
    <iframe id="iframe" src="http://www.medicamall.com"></iframe>
</body>

这是 CSS 代码

body {
    margin:0;
    padding:0;
    height:100%;
}
#iframe {
    border:none;
    width:100%;
    height:calc(100% + 200px);  
    position: absolute;
    overflow: hidden;
}

我需要从 iframe 底部隐藏特定的 200px
当我使用 height:calc(100% + 200px); 它对我有用
但是当滚动到页面底部时,它会出现滚动
如何防止该区域也滚动显示

【问题讨论】:

    标签: javascript jquery html css iframe


    【解决方案1】:

    您需要移动 CSS 以将溢出隐藏到 iframe 的父容器。

    body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
    }
    #iframe {
        border: none;
        width: 100%;
        height: calc(100% + 200px);
        position: absolute;
    }
    

    你可以在我的 plnkr 上看到一个例子。

    http://embed.plnkr.co/xFXzg7g90Itpuee6hKB9/

    【讨论】:

      猜你喜欢
      • 2023-04-06
      • 2020-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-04
      • 2013-08-21
      • 1970-01-01
      • 2013-04-13
      相关资源
      最近更新 更多