【发布时间】:2012-08-01 08:10:52
【问题描述】:
我不做 CSS,这就是为什么我很难调整它。我的弹出窗口使用 Iframe 时遇到问题。在 css 中有这样的样式:
iframe {
border:none;
height:440px;
margin-left:4px;
margin-right:4px;
**min-width:760px;**
overflow:auto;
width:98%;
}
当这样查看页面时,它会生成一个 html:
<div style="left: 404px; top: 75px; visibility: visible; position: absolute; overflow: visible; clip: rect(auto auto auto auto); " class="dialogPanel"><div class="">.....</div>
这就是为什么无论我如何在后面的代码中设置高度,它都不会相应地调整大小:
profileFrame = new Frame(url);
profileFrame.setHeight("350px");
profileFrame.setWidth("450px");
panel.add(profileFrame);
content.add(panel);
但是当我从 CSS iframe 中删除最小宽度时,它已经根据我的意愿调整了大小。
问:我的这个特定 iframe 如何不使用 iframe 样式?我不想删除最小宽度,因为应用程序中的所有 iframe 都在使用这种样式。
我尝试使用 profileFrame.removeStyleName("iframe") 删除它,我还尝试了所有其他可用的 removestyle 方法,但没有奏效。
有什么建议吗?谢谢
【问题讨论】:
-
我相信要记住,“本地”CSS 胜过“页面 CSS”,后者胜过“包含 CSS”。这意味着,如果您将 min-width 放入 iframe-tag 并将其设置为“0”,它可能会为您解决问题。
-
标签是(以编程方式)生成的,而不是来自解决方案页面的 html 布局,所以我无法做到这一点。谢谢
标签: css gwt iframe resize popup