我想实现这样的布局:
-----------------------------------------------------------
| |
| fixed height |
| |
|----------------------------------------------------------|
| | s |
| takes all the rest available screen height | c |
| fluid height, not fixed, | r |
| dependent on the screen height | o |
| | l |
| | l |
| | b |
| | a |
| | r |
------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
使用css和html,没有javascript,是否可能?滚动条应从上到下完全可见.
请参阅: http ://jsfiddle.net/s7FH6/show/(编辑)
HTML:
<div id="header"></div>
<div id="content"></div>
Run Code Online (Sandbox Code Playgroud)
CSS:
html, body {
margin: 0;
padding: 0;
overflow: hidden
}
#header {
background: #ccc;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 150px
}
#content {
background: #eee;
position: absolute;
left: 0;
top: 150px;
bottom: 0;
width: 100%;
overflow-y: scroll
}
Run Code Online (Sandbox Code Playgroud)