我有一些html...
<html>
<body>
<div id="outfit-wrapper">
<div class="ui-droppable" id="outfit-area"> <!-- drop to this area -->
content...
</div>
<div id="products-area"> <!-- drag from this area -->
content...
</div> <!-- end products-area -->
</div>
</body>
</html>
选定的 css 相关部分如下所示:
html, body {
margin: 0;
padding: 0;
height: 100%;
}
#outfit-wrapper {
position:absolute;
width:98%;
margin-left:1%;
margin-right:1%;
height: auto !important; /* ie6 ignores !important, so this will be overridden below */
min-height: 100%; /* ie6 ignores min-height completely */
height: 100%;
border-left:1px solid #dfdfdf;
border-right:1px solid #dfdfdf;
padding:0;
}
#outfit-area {
position:absolute;
height:100%;
float:left;
width:60%;
overflow: hidden;
border-right:1px solid #dfdfdf;
}
#products-area {
float:right;
width:40%;
}
它工作得很好,装备包装是网络浏览器高度的 100%。#outfit-area 和 #products-area 按预期填充了 100% 的 #outfit-wrapper div。
现在我想要一个在#outfit-wrapper 顶部包含一些内容的 div:
<html>
<body>
<div id="outfit-wrapper">
<div id="header">content</div>
<div class="ui-droppable" id="outfit-area"> <!-- drop to this area -->
content...
</div>
<div id="products-area"> <!-- drag from this area -->
content...
</div> <!-- end products-area -->
</div>
</body>
</html>
我希望包装器具有与以前相同的高度,我只想添加 header-div。我需要 header-div 和“#outfit-area 和 #products-area”的高度为 100%。我如何实现这一目标?我必须添加这样的 div 元素吗?
<html>
<body>
<div id="outfit-wrapper">
<div id="header">content</div>
<div id="content-area">
<div class="ui-droppable" id="outfit-area"> <!-- drop to this area -->
content...
</div>
<div id="products-area"> <!-- drag from this area -->
content...
</div> <!-- end products-area -->
</div> <!-- end content-area -->
</div>
</body>
</html>
出于某种奇怪的原因 - 如果我将#products-area 设置为 position:absolute,那么我就不能使用可拖动的功能。如果您对我的问题有一个好的答案,请考虑到这一点:-)