html - iframe 溢出 div

标签 html css iframe

我正在使用一个 div 来容纳一个 iframe 来模拟一个弹出窗口。但是,iframe 加载的网页有一个下拉菜单,最终位于 div 之外。我如何使它留在 div 中?我认为这可能是一个溢出问题,但我所做的一切似乎都没有改变。图片是我说的截图。 Overflow problem .当到达较暗区域时,下拉菜单应该停止。

<head>
<style>
 #box{
        display: none;
        position:fixed;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: black;
        z-index:1001; 
        -moz-opacity: 0.4;
        opacity:.40;
        filter: alpha(opacity=40);
    }

    #popup{ 
        display: none;
        position: fixed;
        top: 35%;
        left: 40%;
        width: 1000px;
        height: 625px;
        margin: -190px 0 0 -281px;
        z-index:1002;
        overflow: auto;
        background-color: white;
    }
    #popupIframe{
        display: block;
        position: fixed;
        top: inherit;
        left: inherit;
        width: inherit;
        height: inherit;
        margin: -190px 0 0 -281px;
        z-index:1000;
        overflow:auto;
        background-color: white;

        }
    #over{
    position: absolute;
    top: 0px;
    right: 3px;
    background-image: url(images/Button-Close-icon.png); 
    background-repeat:no-repeat;
    height: 32px;
    width:32px;
    z-index:1003;
}

</style>

</head>

<body>
<div id = "popup">
   <iframe id = "popupIframe"  src = "
http://quote.test.usli.com/instantquote/quote/promotion
" ></iframe> 
    <div id="over" onClick="closePopup();" > </div>
</div>
</body>

最佳答案

尝试给予

overflow:none #popup div

#popup{ 
    display: none;
    position: fixed;
    top: 35%;
    left: 40%;
    width: 1000px;
    height: 625px;
    margin: -190px 0 0 -281px;
    z-index:1002;
    overflow: none;
    background-color: white;
}

关于html - iframe 溢出 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23570381/

相关文章:

CSS - flex 网格布局

javascript - 使用来自 CamanJS API 的预设过滤器

javascript - iframe src 更改,Javascript 不起作用

html - 在 IE10 iframe 中强制 IE8 仿真

javascript - 没有用于跨源 iframe 的不安全内联注册 onload 处理程序的 CSP

html - 不同 1280 分辨率的 CSS 媒体查询问题

javascript - WordPress:一页滚动 JQuery 脚本不起作用?

div 类中的 PHP 变量

css - 旧 IE 回退 : modernizr, 星黑客或其他方式的最便宜的方法?

html - 流经下一行的总百分比为 100%