我有一个 div,我正在通过简单的 css 调整其大小,该 css 在 chrome、firefox 和其他一些浏览器上可以完美地调整大小,但它似乎在 Internet Explorer 上没有执行任何操作。我已将我的代码放在下面来查看它,因为我不确定我缺少什么。如果可能的话,我希望将解决方案保留在 css 中,但如果我需要实现其他东西,我愿意接受选项和任何帮助。谢谢。
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Pragma" content="no-cache">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, width=device-width">
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="width">
<style type="text/css">
* { margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; color: #ffffff; background-color: #000000; }
#banner { width: 100%; height: 100%; border: none; overflow: hidden; float:left; z-index:9; }
#BodyContainer { position: absolute; top: 150px; left: 0px; bottom: 0px; right: 0px; clear: both; }
#bottom { width: 100%; height: 100%; border: none; }
.resizable {
resize: vertical;
display: block;
width: 100%;
height: 120px;
border: 2px black;
overflow: hidden;
position: relative;
box-shadow: 1px 1px 1px #33A6A6;
z-index:9;
}
</style>
</head>
<body>
<div></div>
<div class="resizable">
<iframe width="100%" height="100%" id="banner" name="BANNER" src="$BASE$/BANNER?$CONFIG$"></iframe>
</div>
<div></div>
<div id="BodyContainer">
<div></div>
<iframe width="100%" height="100%" id="bottom" name="BODY" src="$BASE$/BODY?$CONFIG$"></iframe>
</div>
</body>
</html>
最佳答案
您正在使用 CSS 调整 div 大小,IE 中尚不支持 resize
属性,如果您想在所有浏览器上实现此效果,那么我建议使用 jQuery 可调整大小,here is a fiddle演示了如何使用它。
请注意,这需要 jQuery 和 jQuery UI 库。
关于javascript - Div 调整大小在 Internet Explorer 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28923785/