我遇到了一个问题,但是我还没有解决。如果你看下面的链接:http://jsfiddle.net/WnmLc/2/
这是我目前得到的内容:
我希望 #right 可以占用其右侧的所有可用空间,而 footer 应该在 #right 的边界内,并且 #right 本身不应延伸到 #bottom 之外。 #content 可以是任何大小,当需要时应显示滚动条,#head 和 #footer 应固定在 #right 的顶部/底部。
很抱歉,我对 JavaScript 的了解比 CSS 更熟悉,所以我需要一些指导。
提前感谢!
<div id="top">top</div>
<div id="bottom">
<div id="left">left</div>
<div id="right">
<div id="head">head</div>
<div id="content">content</div>
<div id="footer">footer</div>
</div>
</div>
这是我目前得到的内容:
#top
{
height: 50px;
}
#bottom
{
position: absolute;
top: 50px;
bottom: 0;
}
#left
{
float: left;
height: 100%;
width: 100px;
}
#right
{
float: left;
height: 100%;
}
#content
{
height: 100%;
overflow: auto;
}
我希望 #right 可以占用其右侧的所有可用空间,而 footer 应该在 #right 的边界内,并且 #right 本身不应延伸到 #bottom 之外。 #content 可以是任何大小,当需要时应显示滚动条,#head 和 #footer 应固定在 #right 的顶部/底部。
很抱歉,我对 JavaScript 的了解比 CSS 更熟悉,所以我需要一些指导。
提前感谢!
#bottom
的position
设为absolute
呢?是因为你想让#bottom
的高度延伸到页面高度吗? - Michelle#left
必须是100像素吗? - Michelle#left
。 - Michelle